X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.h;h=db6165fed82628206f29d69b39036d2160edefca;hb=b160f64ab6da260bad06a4e5f5bfed243e2cdc24;hp=477eaca382fa55dbe6ab1925fb62677db1ed72c1;hpb=e37851b98dde5082ee92570354746f2f92e21940;p=libs%2Fgl.git diff --git a/source/texture.h b/source/texture.h index 477eaca3..db6165fe 100644 --- a/source/texture.h +++ b/source/texture.h @@ -4,12 +4,11 @@ #include #include "gl.h" #include "predicate.h" +#include "resource.h" namespace Msp { namespace GL { -class Resources; - enum TextureFilter { /// No filtering @@ -65,7 +64,7 @@ texture to be usable. If texture coordinates fall outside of the principal range of the texture, wrapping is applied. The default for all directions is REPEAT. */ -class Texture +class Texture: public Resource { protected: class Loader: public DataFile::CollectionObjectLoader @@ -116,7 +115,7 @@ protected: Predicate cmp_func; mutable int dirty_params; - Texture(GLenum); + Texture(GLenum, ResourceManager * = 0); Texture(const Texture &); Texture &operator=(const Texture &); public: @@ -145,6 +144,10 @@ public: when a texture image is uploaded. */ void set_generate_mipmap(bool); +protected: + void auto_generate_mipmap(); + +public: /** Sets depth texture comparison. Has no effect on other formats. When comparison is enabled, the third component of the texture coordinate is compared against the texel value, and the result is returned as the texture @@ -163,6 +166,8 @@ public: static const Texture *current(unsigned = 0); static void unbind() { unbind_from(0); } static void unbind_from(unsigned); + + virtual UInt64 get_data_size() const { return 0; } }; } // namespace GL