bloboland

view src/texture.h @ 1:cfe68befb7cc

some progress
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 15 Dec 2012 23:43:03 +0200
parents
children a39c301cdcce
line source
1 #ifndef TEXTURE_H_
2 #define TEXTURE_H_
4 class Texture {
5 protected:
6 unsigned int type;
7 unsigned int tex;
9 int size[3];
11 public:
12 Texture();
13 virtual ~Texture();
15 virtual int get_size(int idx) const;
17 friend void bind_texture(const Texture *tex, int texunit);
18 };
20 void bind_texture(const Texture *tex, int texunit = 0);
22 class Texture2D : public Texture {
23 public:
24 Texture2D();
26 void create(int xsz, int ysz, float *data = 0);
27 };
29 class Texture3D : public Texture {
30 public:
31 Texture3D();
33 void create(int xsz, int ysz, int zsz, float *data = 0);
34 };
36 #endif // TEXTURE_H_