X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.h;h=030fe408ad0a2b08bcdc448fe1f305703c3d8dce;hb=f9d27a44f11dcb2980ea7c65d410e9002098487f;hp=639d47a6cee591d3a39ad6cbeced110c75550a0a;hpb=a1eb8711ba225bb4423868c50369ad5592465171;p=libs%2Fgl.git diff --git a/source/texture2d.h b/source/texture2d.h index 639d47a6..030fe408 100644 --- a/source/texture2d.h +++ b/source/texture2d.h @@ -3,8 +3,7 @@ #include #include -#include "datatype.h" -#include "pixelformat.h" +#include "resource.h" #include "texture.h" namespace Msp { @@ -33,13 +32,16 @@ public: }; private: + class AsyncLoader; + PixelFormat ifmt; unsigned width; unsigned height; unsigned allocated; public: - Texture2D(); + Texture2D(ResourceManager * = 0); + virtual ~Texture2D(); /** Defines storage structure for the texture. Must be called before an image can be uploaded. Once storage is defined, it can't be changed. */ @@ -71,11 +73,20 @@ public: format will be used. */ void image(const Graphics::Image &, bool srgb = false); +private: + void image(const Graphics::Image &, bool, bool); + +public: unsigned get_width() const { return width; } unsigned get_height() const { return height; } private: void get_level_size(unsigned, unsigned &, unsigned &); + +public: + virtual Resource::AsyncLoader *load(IO::Seekable &, const Resources * = 0); + virtual UInt64 get_data_size() const; + virtual void unload(); }; } // namespace GL