X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.h;h=23f3bb2539ab5f9e9c544ccb00b73cc601e48f35;hb=cb836adcf11f690188df9b7bc59f3fe87b67aaa7;hp=4cd5481e2e18f570377c3f13d86b8b4dbf984cb8;hpb=f35535633aab06e80f0666d8551431364654c6dc;p=libs%2Fgl.git diff --git a/source/texture.h b/source/texture.h index 4cd5481e..23f3bb25 100644 --- a/source/texture.h +++ b/source/texture.h @@ -2,6 +2,7 @@ #define MSP_GL_TEXTURE_H_ #include +#include #include "datatype.h" #include "gl.h" #include "pixelformat.h" @@ -80,8 +81,10 @@ protected: private: void init(); + void external_image(const std::string &); void filter(TextureFilter); void generate_mipmap(bool); + void image_data(const std::string &); void mag_filter(TextureFilter); void max_anisotropy(float); void min_filter(TextureFilter); @@ -161,6 +164,17 @@ public: /** Sets the function to use for depth comparison. */ void set_compare_func(Predicate); + /// Loads a Graphics::Image from a file and uploads it to the texture. + virtual void load_image(const std::string &, bool srgb = false); + + /** Uploads an image to the texture. If storage has not been defined, it + will be set to match the image. Otherwise the image must be compatible + with the defined storage. Semantics depend on the type of texture. + + If srgb is true and storage is determined by this call, then an sRGB pixel + format will be used. */ + virtual void image(const Graphics::Image &, bool srgb = false) = 0; + GLenum get_target() const { return target; } unsigned get_id() const { return id; } @@ -174,6 +188,9 @@ public: virtual UInt64 get_data_size() const { return 0; } }; + +bool is_mipmapped(TextureFilter); + } // namespace GL } // namespace Msp