X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Fgl_texture.cpp;h=413d0ce247127014cfa631be5dc8b9380fd1f26a;hb=5742dd7bfaf2fa8ffdb812bbc150826554959c98;hp=e9d72d0abafea16f82c920c45b6cde8cfb9052b5;hpb=20efd7620620892d92b1c7df124c3a0c8df22a82;p=supertux.git diff --git a/src/video/gl_texture.cpp b/src/video/gl_texture.cpp index e9d72d0ab..413d0ce24 100644 --- a/src/video/gl_texture.cpp +++ b/src/video/gl_texture.cpp @@ -111,9 +111,17 @@ namespace GL glBindTexture(GL_TEXTURE_2D, handle); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel); + if(SDL_MUSTLOCK(convert)) + { + SDL_LockSurface(convert); + } glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width, texture_height, 0, sdl_format, GL_UNSIGNED_BYTE, convert->pixels); + if(SDL_MUSTLOCK(convert)) + { + SDL_UnlockSurface(convert); + } assert_gl("creating texture");