1 #ifndef MSP_GL_TEXTURE_H_
2 #define MSP_GL_TEXTURE_H_
4 #include <msp/datafile/objectloader.h>
15 NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST,
16 NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR,
17 LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST,
18 LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR
25 CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE,
26 MIRRORED_REPEAT = GL_MIRRORED_REPEAT
31 Base class for textures. This class only defines operations common for all
32 texture types and is not instantiable. For specifying images for textures, see
33 one of the dimensioned texture classes.
38 class Loader: public DataFile::ObjectLoader<Texture>
42 void generate_mipmap(bool);
43 void mag_filter(TextureFilter);
44 void min_filter(TextureFilter);
45 void wrap(TextureWrap);
46 void wrap_r(TextureWrap);
47 void wrap_s(TextureWrap);
48 void wrap_t(TextureWrap);
65 TextureFilter min_filter;
66 TextureFilter mag_filter;
73 mutable int dirty_params;
76 Texture(const Texture &);
77 Texture &operator=(const Texture &);
82 void update_parameter(int) const;
84 void set_min_filter(TextureFilter);
85 void set_mag_filter(TextureFilter);
86 void set_wrap(TextureWrap);
87 void set_wrap_s(TextureWrap);
88 void set_wrap_t(TextureWrap);
89 void set_wrap_r(TextureWrap);
90 void set_generate_mipmap(bool);
91 void set_compare_enabled(bool);
92 void set_compare_func(Predicate);
93 GLenum get_target() const { return target; }
94 unsigned get_id() const { return id; }
97 void bind_to(unsigned) const;
99 static const Texture *current();
100 static void unbind();
101 static void unbind_from(unsigned);