conworlds
view 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 |
line source
1 #ifndef TEXTURE_H_
2 #define TEXTURE_H_
4 #include "image.h"
6 class Texture {
7 private:
8 Image img;
9 unsigned int tex;
10 unsigned int type;
12 public:
13 Texture();
14 ~Texture();
16 void create2d(int xsz, int ysz);
17 void destroy();
19 void set_image(const Image &img);
20 Image &get_image();
21 const Image &get_image() const;
23 unsigned int get_texture_id() const;
24 void bind(int tunit = 0) const;
26 bool load(const char *fname);
27 };
29 #endif // TEXTURE_H_