Subversion Repositories gelsvn

Rev

Rev 79 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 79 Rev 125
1
#ifndef __TEXMAP_H__
1
#ifndef __TEXMAP_H__
2
#define __TEXMAP_H__
2
#define __TEXMAP_H__
3
 
3
 
4
#include <string>
4
#include <string>
5
#include <CGLA/Vec3f.h>
5
#include <CGLA/Vec3f.h>
-
 
6
#if defined(__APPLE__) && defined(__MACH__)
-
 
7
#include <OpenGL/gl.h>
6
 
8
#else
-
 
9
#include <GL/gl.h>
-
 
10
#endif
7
 
11
 
8
namespace Geometry
12
namespace Geometry
9
{
13
{
10
	class Texmap 
14
	class Texmap 
11
	{
15
	{
12
		unsigned int id;
16
		GLuint id;
13
		unsigned char *image;
17
		unsigned char *image;
14
		unsigned int bpp;
18
		unsigned int bpp;
15
		int size_x;
19
		int size_x;
16
		int size_y;
20
		int size_y;
17
		int load_size_x;
21
		int load_size_x;
18
		int load_size_y;
22
		int load_size_y;
19
		std::string name;
23
		std::string name;
20
 
24
 
21
	public:
25
	public:
22
 
26
 
23
		// Constuctor/destructor
27
		// Constuctor/destructor
24
		Texmap();
28
		Texmap();
25
		~Texmap();
29
		~Texmap();
26
 
30
 
27
		const std::string& get_name() const {return name;}
31
		const std::string& get_name() const {return name;}
28
		bool load(const std::string& _name);
32
		bool load(const std::string& _name);
29
		CGLA::Vec3f get_texel(int u, int v);
33
		CGLA::Vec3f get_texel(int u, int v);
30
 
34
 
31
		void gl_init();
35
		void gl_init();
32
		void gl_bind();
36
		void gl_bind();
33
	};
37
	};
34
 
38
 
35
}
39
}
36
#endif
40
#endif
37
 
41
 
38
 
42
 
39
 
43
 
40
 
44