]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/texturecube_backend.cpp
Always delay texture creation until it is allocated
[libs/gl.git] / source / backends / opengl / texturecube_backend.cpp
index b113f1bd21ba1a13f01effd610d67df8e7e01624..cc8945896fea9bdaad6763e4eedda5af50df859c 100644 (file)
@@ -31,6 +31,9 @@ void OpenGLTextureCube::allocate()
        unsigned size = static_cast<const TextureCube *>(this)->size;
        unsigned levels = static_cast<const TextureCube *>(this)->levels;
 
+       if(!id)
+               generate_id();
+
        GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
        if(ARB_texture_storage)
        {