X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture.h;h=f6436c0acc8f6e51d7d8679710bbaf47ad29b67b;hb=e70662d7812464159f2e47f4bebb69d88f89ae93;hp=13ff5bc9f73095094a0800cd1efbd5aaa3a4246a;hpb=190a7e11237351f6b730c28f7b16f183e8adc69c;p=libs%2Fgl.git diff --git a/source/core/texture.h b/source/core/texture.h index 13ff5bc9..f6436c0a 100644 --- a/source/core/texture.h +++ b/source/core/texture.h @@ -49,12 +49,12 @@ protected: void load_external_image(Graphics::Image &, const std::string &); private: - void external_image(const std::string &); - void external_image_srgb(const std::string &); - void external_image_common(const std::string &); + void external_data(const std::string &); + void external_image(bool, const std::string &); void generate_mipmap(bool); void image_data(const std::string &); void mipmap_levels(unsigned); + void raw_data(const std::string &); }; public: @@ -70,17 +70,9 @@ public: }; protected: - enum FormatSwizzle - { - NO_SWIZZLE, - R_TO_LUMINANCE, - RG_TO_LUMINANCE_ALPHA, - RGB_TO_BGR - }; - PixelFormat format; PixelFormat storage_fmt; - FormatSwizzle swizzle; + ComponentSwizzle swizzle; bool use_srgb_format; bool auto_gen_mipmap; @@ -93,6 +85,11 @@ public: using TextureBackend::generate_mipmap; + /** Replaces contents of an entire mipmap level. Allocated storage must + exist. The image data is interpreted according to the storage format and + must have size matching the selected mipmap level. */ + virtual void image(unsigned level, const void *) = 0; + /** Loads an image into the texture from a file. */ virtual void load_image(const std::string &, unsigned = 0);