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/objectloader.h>
22 NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST,
23 NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR,
24 LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST,
25 LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR
28 std::istream &operator>>(std::istream &, TextureFilter &);
32 Base class for textures. This class only defines operations common for all
33 texture types and is not instantiable. For specifying images for textures, see
34 one of the dimensioned texture classes.
39 class Loader: public DataFile::ObjectLoader<Texture>
43 void min_filter(TextureFilter);
44 void mag_filter(TextureFilter);
45 void generate_mipmap(bool);
52 void bind_to(unsigned) const;
53 void parameter(GLenum, int);
54 void parameter(GLenum, float);
55 void set_min_filter(TextureFilter f) { parameter(GL_TEXTURE_MIN_FILTER, f); }
56 void set_mag_filter(TextureFilter f) { parameter(GL_TEXTURE_MAG_FILTER, f); }
57 GLenum get_target() const { return target; }
58 unsigned get_id() const { return id; }
61 static void unbind_from(unsigned);
67 Texture(const Texture &);
68 Texture &operator=(const Texture &);
69 void maybe_bind() const;