conworlds

view src/texture.h @ 6:3c36bc28c6c2

more stuff in the vr test
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 21 Aug 2014 01:08:03 +0300
parents 879194e4b1f0
children bd8202d6d28d
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 unsigned int next_pow2(unsigned int x);
31 #endif // TEXTURE_H_