bloboland

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/texture.h	Sat Dec 15 23:43:03 2012 +0200
     1.3 @@ -0,0 +1,36 @@
     1.4 +#ifndef TEXTURE_H_
     1.5 +#define TEXTURE_H_
     1.6 +
     1.7 +class Texture {
     1.8 +protected:
     1.9 +	unsigned int type;
    1.10 +	unsigned int tex;
    1.11 +
    1.12 +	int size[3];
    1.13 +
    1.14 +public:
    1.15 +	Texture();
    1.16 +	virtual ~Texture();
    1.17 +
    1.18 +	virtual int get_size(int idx) const;
    1.19 +
    1.20 +	friend void bind_texture(const Texture *tex, int texunit);
    1.21 +};
    1.22 +
    1.23 +void bind_texture(const Texture *tex, int texunit = 0);
    1.24 +
    1.25 +class Texture2D : public Texture {
    1.26 +public:
    1.27 +	Texture2D();
    1.28 +
    1.29 +	void create(int xsz, int ysz, float *data = 0);
    1.30 +};
    1.31 +
    1.32 +class Texture3D : public Texture {
    1.33 +public:
    1.34 +	Texture3D();
    1.35 +
    1.36 +	void create(int xsz, int ysz, int zsz, float *data = 0);
    1.37 +};
    1.38 +
    1.39 +#endif	// TEXTURE_H_