]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
[libs/gl.git] / source / texture2d.cpp
index de75420973134b3d0aa1d2e2275365778b407915..64ad124f97a1952f19307d429c8f9acd427d76c1 100644 (file)
@@ -63,7 +63,8 @@ void Texture2D::allocate(unsigned level)
        if(allocated&(1<<level))
                return;
 
-       image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+       PixelFormat base_fmt = get_base_pixelformat(ifmt);
+       image(level, base_fmt, get_alloc_type(base_fmt), 0);
 }
 
 void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)