X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.h;h=61b1bebdbac92611e9fcc853eea99a4a4e19a5a4;hb=d653d25b548070c688e40c052730d63345ce70c9;hp=6c3541d446ef01d817ae88e3611d3dccb0a05f9e;hpb=a361efc05fcad11b2918f3cd7abdebe794b131d8;p=libs%2Fgl.git diff --git a/source/texture.h b/source/texture.h index 6c3541d4..61b1bebd 100644 --- a/source/texture.h +++ b/source/texture.h @@ -8,7 +8,9 @@ Distributed under the LGPL #ifndef MSP_GL_TEXTURE_H_ #define MSP_GL_TEXTURE_H_ -#include +#include +#include +#include "gl.h" #include "types.h" namespace Msp { @@ -24,6 +26,9 @@ enum TextureFilter LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR }; +std::istream &operator>>(std::istream &, TextureFilter &); + + /** Base class for textures. This class only defines operations common for all texture types and is not instantiable. For specifying images for textures, see @@ -31,10 +36,24 @@ one of the dimensioned texture classes. */ class Texture { +protected: + class Loader: public DataFile::Loader + { + protected: + Texture &tex; + + public: + Loader(Texture &); + void min_filter(TextureFilter); + void mag_filter(TextureFilter); + void generate_mipmap(bool); + }; + public: ~Texture(); void bind() const; + void bind_to(unsigned) const; void parameter(GLenum, int); void parameter(GLenum, float); void set_min_filter(TextureFilter f) { parameter(GL_TEXTURE_MIN_FILTER, f); }