X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2d_backend.cpp;h=c47600cf9402f99a0a41f41df9c43f753ccbfcde;hb=4965ad140daacd10e77b74ce9b49e98c4c4dae55;hp=71a998dcd31187585fd266c1c5e4b19d1369917d;hpb=160e9eea29bd10034733d59507fa1bcca36be401;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2d_backend.cpp b/source/backends/opengl/texture2d_backend.cpp index 71a998dc..c47600cf 100644 --- a/source/backends/opengl/texture2d_backend.cpp +++ b/source/backends/opengl/texture2d_backend.cpp @@ -41,6 +41,9 @@ void OpenGLTexture2D::allocate() unsigned height = static_cast(this)->height; unsigned levels = static_cast(this)->levels; + if(!id) + create(); + GLenum gl_fmt = get_gl_pixelformat(storage_fmt); if(ARB_texture_storage) { @@ -144,7 +147,7 @@ bool OpenGLTexture2D::AsyncLoader::process() } if(!texture.id) - texture.generate_id(); + texture.create(); unsigned w = image.get_width(); unsigned h = image.get_height();