conworlds

view src/texture.h @ 7:bd8202d6d28d

some progress...
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 22 Aug 2014 16:55:16 +0300
parents 3c36bc28c6c2
children 283cdfa7dda2
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 int get_width() const;
17 int get_height() const;
19 void create2d(int xsz, int ysz);
20 void destroy();
22 void set_image(const Image &img);
23 Image &get_image();
24 const Image &get_image() const;
26 unsigned int get_texture_id() const;
27 void bind(int tunit = 0) const;
29 bool load(const char *fname);
30 };
32 unsigned int next_pow2(unsigned int x);
34 #endif // TEXTURE_H_