bloboland
annotate 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 |
rev | line source |
---|---|
nuclear@1 | 1 #ifndef TEXTURE_H_ |
nuclear@1 | 2 #define TEXTURE_H_ |
nuclear@1 | 3 |
nuclear@1 | 4 class Texture { |
nuclear@1 | 5 protected: |
nuclear@1 | 6 unsigned int type; |
nuclear@1 | 7 unsigned int tex; |
nuclear@1 | 8 |
nuclear@1 | 9 int size[3]; |
nuclear@1 | 10 |
nuclear@1 | 11 public: |
nuclear@1 | 12 Texture(); |
nuclear@1 | 13 virtual ~Texture(); |
nuclear@1 | 14 |
nuclear@1 | 15 virtual int get_size(int idx) const; |
nuclear@1 | 16 |
nuclear@1 | 17 friend void bind_texture(const Texture *tex, int texunit); |
nuclear@1 | 18 }; |
nuclear@1 | 19 |
nuclear@1 | 20 void bind_texture(const Texture *tex, int texunit = 0); |
nuclear@1 | 21 |
nuclear@1 | 22 class Texture2D : public Texture { |
nuclear@1 | 23 public: |
nuclear@1 | 24 Texture2D(); |
nuclear@1 | 25 |
nuclear@1 | 26 void create(int xsz, int ysz, float *data = 0); |
nuclear@1 | 27 }; |
nuclear@1 | 28 |
nuclear@1 | 29 class Texture3D : public Texture { |
nuclear@1 | 30 public: |
nuclear@1 | 31 Texture3D(); |
nuclear@1 | 32 |
nuclear@1 | 33 void create(int xsz, int ysz, int zsz, float *data = 0); |
nuclear@1 | 34 }; |
nuclear@1 | 35 |
nuclear@1 | 36 #endif // TEXTURE_H_ |