]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.cpp
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
[libs/gl.git] / source / texturecube.cpp
index 37390a853612523e503889230f030f2a70d2b73d..24d02f4022b2aeac380410ea481a2e392181f8af 100644 (file)
@@ -47,8 +47,10 @@ void TextureCube::allocate(unsigned level)
        if(allocated&(1<<level))
                return;
 
+       PixelFormat base_fmt = get_base_pixelformat(ifmt);
+       DataType type = get_alloc_type(base_fmt);
        for(unsigned i=0; i<6; ++i)
-               image(enumerate_faces(i), level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+               image(enumerate_faces(i), level, base_fmt, type, 0);
 }
 
 void TextureCube::image(TextureCubeFace face, unsigned level, PixelFormat fmt, DataType type, const void *data)