X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturecube.h;h=fd4670469fd1ab0500b607a35e723fe7e9205b65;hb=4a577ddc946bd279d7bc4942a2ce4c46c7ef5d35;hp=0d23884f1458626b954f2a6badd871d38ff9026f;hpb=2157e9320c60d561208dfdf6034e9a06781c9f30;p=libs%2Fgl.git diff --git a/source/texturecube.h b/source/texturecube.h index 0d23884f..fd467046 100644 --- a/source/texturecube.h +++ b/source/texturecube.h @@ -1,8 +1,8 @@ #ifndef MSP_GL_TEXTURECUBE_H_ #define MSP_GL_TEXTURECUBE_H_ -#include "datatype.h" -#include "pixelformat.h" +#include +#include #include "texture.h" #include "vector.h" @@ -33,6 +33,21 @@ Requires OpenGL version 1.3. */ class TextureCube: public Texture { +public: + class Loader: public Msp::DataFile::DerivedObjectLoader + { + public: + Loader(TextureCube &); + Loader(TextureCube &, Collection &); + private: + void init(); + + void external_image(TextureCubeFace, const std::string &); + void image_data(TextureCubeFace, const std::string &); + void raw_data(TextureCubeFace, const std::string &); + void storage(PixelFormat, unsigned); + }; + private: PixelFormat ifmt; unsigned size; @@ -64,6 +79,10 @@ public: int x, int y, unsigned w, unsigned h, PixelFormat fmt, DataType type, const void *data); + void image(TextureCubeFace, const Graphics::Image &, bool = false); + + virtual void image(const Graphics::Image &, bool = false); + unsigned get_size() const { return size; } private: unsigned get_level_size(unsigned); @@ -84,8 +103,14 @@ public: /** Returns a vector pointing to the center a texel. */ Vector3 get_texel_direction(TextureCubeFace, unsigned, unsigned); + + virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; } + virtual UInt64 get_data_size() const; + virtual void unload() { } }; +void operator>>(const LexicalConverter &, TextureCubeFace &); + } // namespace GL } // namespace Msp