X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Ftexture.h;h=96b17b8910752e0f0f46f7466b2acf7d014e2746;hp=8db5dad83e0a90e6aa1bcde5a641f487a5e88355;hb=HEAD;hpb=260ecf71f02d4b3397e4f6c80d96a7c4ba473185 diff --git a/source/core/texture.h b/source/core/texture.h index 8db5dad8..96b17b89 100644 --- a/source/core/texture.h +++ b/source/core/texture.h @@ -49,6 +49,7 @@ protected: void load_external_image(Graphics::Image &, const std::string &); private: + void external_data(const std::string &); void external_image(bool, const std::string &); void generate_mipmap(bool); void image_data(const std::string &); @@ -69,23 +70,19 @@ public: }; protected: - enum FormatSwizzle - { - NO_SWIZZLE, - R_TO_LUMINANCE, - RG_TO_LUMINANCE_ALPHA, - RGB_TO_BGR - }; - - PixelFormat format; - PixelFormat storage_fmt; - FormatSwizzle swizzle; - bool use_srgb_format; - bool auto_gen_mipmap; + PixelFormat format = NO_PIXELFORMAT; + PixelFormat storage_fmt = NO_PIXELFORMAT; + ComponentSwizzle swizzle = NO_SWIZZLE; + unsigned n_levels = 0; + bool use_srgb_format = false; + bool auto_gen_mipmap = false; Texture(unsigned); void set_format(PixelFormat); + static unsigned count_levels(unsigned); + + void stage_pixels(void *, const void *, std::size_t); public: PixelFormat get_format() const { return format; }