X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture.h;h=c593c0ad5236657ac4f08b45ded75f8c3a144f4b;hb=be6ffe96ecb4707599fe1a6f620c348760213d46;hp=2f647b90cae721837f441a59c4c67e5c5f3f31fd;hpb=f19366d32cc29287a2730cfba90893e407754081;p=libs%2Fgl.git diff --git a/source/core/texture.h b/source/core/texture.h index 2f647b90..c593c0ad 100644 --- a/source/core/texture.h +++ b/source/core/texture.h @@ -1,6 +1,7 @@ #ifndef MSP_GL_TEXTURE_H_ #define MSP_GL_TEXTURE_H_ +#include #include #include #include "pixelformat.h" @@ -49,6 +50,19 @@ protected: void mipmap_levels(unsigned); }; +public: + class GenericLoader: public DataFile::DynamicObjectLoader + { + friend class Texture; + + public: + GenericLoader(Collection &c): DynamicObjectLoader(&c) { } + + protected: + virtual const TypeRegistry &get_type_registry() const { return get_texture_registry(); } + }; + +protected: enum FormatSwizzle { NO_SWIZZLE, @@ -63,7 +77,7 @@ protected: bool use_srgb_format; bool auto_gen_mipmap; - Texture(unsigned, ResourceManager * = 0); + Texture(unsigned); void set_format(PixelFormat); @@ -80,9 +94,12 @@ public: with the defined storage. Semantics depend on the type of texture. */ virtual void image(const Graphics::Image &, unsigned = 0) = 0; - virtual std::uint64_t get_data_size() const { return 0; } + virtual std::size_t get_data_size() const { return 0; } using TextureBackend::set_debug_name; + +private: + static GenericLoader::TypeRegistry &get_texture_registry(); }; } // namespace GL