conworlds

view src/texture.h @ 20:782ff06817fb

merged ...
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 26 Aug 2014 18:42:53 +0300
parents bd8202d6d28d
children
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_type() const;
27 unsigned int get_texture_id() const;
29 bool load(const char *fname);
30 };
32 void bind_texture(const Texture *tex, int unit = 0);
34 unsigned int next_pow2(unsigned int x);
36 #endif // TEXTURE_H_