conworlds

diff src/texture.h @ 0:b326d53321f7

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 Apr 2014 05:20:53 +0300
parents
children 879194e4b1f0
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/texture.h	Fri Apr 25 05:20:53 2014 +0300
     1.3 @@ -0,0 +1,29 @@
     1.4 +#ifndef TEXTURE_H_
     1.5 +#define TEXTURE_H_
     1.6 +
     1.7 +#include "image.h"
     1.8 +
     1.9 +class Texture {
    1.10 +private:
    1.11 +	Image img;
    1.12 +	unsigned int tex;
    1.13 +	unsigned int type;
    1.14 +
    1.15 +public:
    1.16 +	Texture();
    1.17 +	~Texture();
    1.18 +
    1.19 +	void create2d(int xsz, int ysz);
    1.20 +	void destroy();
    1.21 +
    1.22 +	void set_image(const Image &img);
    1.23 +	Image &get_image();
    1.24 +	const Image &get_image() const;
    1.25 +
    1.26 +	unsigned int get_texture_id() const;
    1.27 +	void bind(int tunit = 0) const;
    1.28 +
    1.29 +	bool load(const char *fname);
    1.30 +};
    1.31 +
    1.32 +#endif	// TEXTURE_H_
    1.33 \ No newline at end of file