]> git.tdb.fi Git - libs/gl.git/commitdiff
Use base pixelformat when loading texture data
authorMikko Rasa <tdb@tdb.fi>
Sun, 5 Jan 2014 10:51:29 +0000 (12:51 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 5 Jan 2014 10:51:29 +0000 (12:51 +0200)
source/texture2d.cpp
source/texturecube.cpp

index 973afebfcf277b75d217e2d0262e83846e06e41a..f4af7e7259bef9ccaf3319be8c56df51cd9881a0 100644 (file)
@@ -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)
index 7f8301187c35e07257037aec9967ad6b502e83a8..d5453c182e128b13e201cb87d7b738e38caefd00 100644 (file)
@@ -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)