]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/texture2d_backend.cpp
Always delay texture creation until it is allocated
[libs/gl.git] / source / backends / opengl / texture2d_backend.cpp
index 71a998dcd31187585fd266c1c5e4b19d1369917d..725b603893973f1a52c47ad35d8dd8c8e69bc771 100644 (file)
@@ -41,6 +41,9 @@ void OpenGLTexture2D::allocate()
        unsigned height = static_cast<const Texture2D *>(this)->height;
        unsigned levels = static_cast<const Texture2D *>(this)->levels;
 
+       if(!id)
+               generate_id();
+
        GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
        if(ARB_texture_storage)
        {