conworlds

annotate src/texture.h @ 3:a797e426e309

minor changes
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 19 Aug 2014 11:01:04 +0300
parents b326d53321f7
children 3c36bc28c6c2
rev   line source
nuclear@2 1 #ifndef TEXTURE_H_
nuclear@2 2 #define TEXTURE_H_
nuclear@2 3
nuclear@2 4 #include "image.h"
nuclear@2 5
nuclear@2 6 class Texture {
nuclear@2 7 private:
nuclear@2 8 Image img;
nuclear@2 9 unsigned int tex;
nuclear@2 10 unsigned int type;
nuclear@2 11
nuclear@2 12 public:
nuclear@2 13 Texture();
nuclear@2 14 ~Texture();
nuclear@2 15
nuclear@2 16 void create2d(int xsz, int ysz);
nuclear@2 17 void destroy();
nuclear@2 18
nuclear@2 19 void set_image(const Image &img);
nuclear@2 20 Image &get_image();
nuclear@2 21 const Image &get_image() const;
nuclear@2 22
nuclear@2 23 unsigned int get_texture_id() const;
nuclear@2 24 void bind(int tunit = 0) const;
nuclear@2 25
nuclear@2 26 bool load(const char *fname);
nuclear@2 27 };
nuclear@2 28
nuclear@2 29 #endif // TEXTURE_H_