]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.cpp
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
[libs/gl.git] / source / texture1d.cpp
index accd0e0c06c76a4bfe0b91f828cc840c5becff49..046fca6fa4eccbe49a5a5174ba498adefc1b892c 100644 (file)
@@ -34,7 +34,8 @@ void Texture1D::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 Texture1D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)