Subversion Repositories gelsvn

Rev

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

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