mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-10 13:28:15 +00:00
render: Fix internal state getting out of sync when destroying a texture that was just rendered and then creating a new one, in the GL and GLES2 backends. Fixes bug #4433.
This commit is contained in:
@@ -1388,6 +1388,13 @@ GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
|
||||
GL_ActivateRenderer(renderer);
|
||||
|
||||
if (renderdata->drawstate.texture == texture) {
|
||||
renderdata->drawstate.texture = NULL;
|
||||
}
|
||||
if (renderdata->drawstate.target == texture) {
|
||||
renderdata->drawstate.target = NULL;
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user