3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_TEXTURE_H_
9 #define MSP_GL_TEXTURE_H_
12 #include <msp/datafile/loader.h>
23 NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST,
24 NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR,
25 LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST,
26 LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR
29 std::istream &operator>>(std::istream &, TextureFilter &);
33 Base class for textures. This class only defines operations common for all
34 texture types and is not instantiable. For specifying images for textures, see
35 one of the dimensioned texture classes.
40 class Loader: public DataFile::Loader
47 void min_filter(TextureFilter);
48 void mag_filter(TextureFilter);
49 void generate_mipmap(bool);
56 void bind_to(unsigned) const;
57 void parameter(GLenum, int);
58 void parameter(GLenum, float);
59 void set_min_filter(TextureFilter f) { parameter(GL_TEXTURE_MIN_FILTER, f); }
60 void set_mag_filter(TextureFilter f) { parameter(GL_TEXTURE_MAG_FILTER, f); }
61 GLenum get_target() const { return target; }
62 uint get_id() const { return id; }
65 static void unbind_from(unsigned);
71 Texture(const Texture &);
72 Texture &operator=(const Texture &);
73 void maybe_bind() const;