bloboland

annotate src/texture.h @ 5:2f4406cc341e

meh
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 19 Dec 2012 02:37:20 +0200
parents 9021a906c5d3
children
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@5 8 unsigned int intfmt;
nuclear@1 9
nuclear@1 10 int size[3];
nuclear@1 11
nuclear@1 12 public:
nuclear@1 13 Texture();
nuclear@1 14 virtual ~Texture();
nuclear@1 15
nuclear@5 16 virtual void set_pixel_format(unsigned int fmt);
nuclear@5 17
nuclear@4 18 virtual void set_filtering(unsigned int min_filter, unsigned int mag_filter = 0);
nuclear@4 19 virtual void set_wrapping(unsigned int wrap);
nuclear@4 20
nuclear@1 21 virtual int get_size(int idx) const;
nuclear@1 22
nuclear@3 23 virtual void update(float *data) = 0;
nuclear@3 24
nuclear@1 25 friend void bind_texture(const Texture *tex, int texunit);
nuclear@1 26 };
nuclear@1 27
nuclear@1 28 void bind_texture(const Texture *tex, int texunit = 0);
nuclear@1 29
nuclear@4 30 class Texture1D : public Texture {
nuclear@4 31 public:
nuclear@4 32 Texture1D();
nuclear@4 33
nuclear@4 34 void create(int sz, float *data = 0);
nuclear@4 35
nuclear@4 36 void update(float *data);
nuclear@4 37 };
nuclear@4 38
nuclear@1 39 class Texture2D : public Texture {
nuclear@1 40 public:
nuclear@1 41 Texture2D();
nuclear@1 42
nuclear@1 43 void create(int xsz, int ysz, float *data = 0);
nuclear@3 44
nuclear@3 45 void update(float *data);
nuclear@1 46 };
nuclear@1 47
nuclear@1 48 class Texture3D : public Texture {
nuclear@1 49 public:
nuclear@1 50 Texture3D();
nuclear@1 51
nuclear@1 52 void create(int xsz, int ysz, int zsz, float *data = 0);
nuclear@3 53
nuclear@3 54 void update(float *data);
nuclear@1 55 };
nuclear@1 56
nuclear@1 57 #endif // TEXTURE_H_