X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexture.h;h=19da006937cf536aef73bc9ae43e0ba3bc3472b1;hb=HEAD;hp=61b1bebdbac92611e9fcc853eea99a4a4e19a5a4;hpb=d16a4ab73f87d177296b59f04880ef7eba593df7;p=libs%2Fgl.git diff --git a/source/texture.h b/source/texture.h deleted file mode 100644 index 61b1bebd..00000000 --- a/source/texture.h +++ /dev/null @@ -1,78 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GL_TEXTURE_H_ -#define MSP_GL_TEXTURE_H_ - -#include -#include -#include "gl.h" -#include "types.h" - -namespace Msp { -namespace GL { - -enum TextureFilter -{ - NEAREST = GL_NEAREST, - LINEAR = GL_LINEAR, - NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST, - NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR, - LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST, - 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 -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); } - void set_mag_filter(TextureFilter f) { parameter(GL_TEXTURE_MAG_FILTER, f); } - GLenum get_target() const { return target; } - uint get_id() const { return id; } - - static void unbind(); -protected: - uint id; - GLenum target; - - Texture(); - Texture(const Texture &); - Texture &operator=(const Texture &); - void maybe_bind() const; -}; - -} // namespace GL -} // namespace Msp - -#endif