conworlds

annotate 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
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@7 16 int get_width() const;
nuclear@7 17 int get_height() const;
nuclear@7 18
nuclear@2 19 void create2d(int xsz, int ysz);
nuclear@2 20 void destroy();
nuclear@2 21
nuclear@2 22 void set_image(const Image &img);
nuclear@2 23 Image &get_image();
nuclear@2 24 const Image &get_image() const;
nuclear@2 25
nuclear@13 26 unsigned int get_type() const;
nuclear@2 27 unsigned int get_texture_id() const;
nuclear@2 28
nuclear@2 29 bool load(const char *fname);
nuclear@2 30 };
nuclear@2 31
nuclear@13 32 void bind_texture(const Texture *tex, int unit = 0);
nuclear@13 33
nuclear@6 34 unsigned int next_pow2(unsigned int x);
nuclear@6 35
nuclear@2 36 #endif // TEXTURE_H_