From: Mikko Rasa Date: Sun, 5 Jan 2014 10:51:29 +0000 (+0200) Subject: Use base pixelformat when loading texture data X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=89dc716abe7fa671e1da1c033d955cd72da73f33;p=libs%2Fgl.git Use base pixelformat when loading texture data --- diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 973afebf..f4af7e72 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -124,7 +124,7 @@ void Texture2D::Loader::image_data(const string &data) void Texture2D::Loader::raw_data(const string &data) { - obj.image(0, obj.ifmt, UNSIGNED_BYTE, data.data()); + obj.image(0, get_base_pixelformat(obj.ifmt), UNSIGNED_BYTE, data.data()); } void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h) diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 7f830118..d5453c18 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -183,7 +183,7 @@ void TextureCube::Loader::image_data(TextureCubeFace face, const string &data) void TextureCube::Loader::raw_data(TextureCubeFace face, const string &data) { - obj.image(face, 0, obj.ifmt, UNSIGNED_BYTE, data.data()); + obj.image(face, 0, get_base_pixelformat(obj.ifmt), UNSIGNED_BYTE, data.data()); } void TextureCube::Loader::storage(PixelFormat fmt, unsigned s)