mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Fixed bug 5291 - SDL_SetRenderTarget unnecessarily changes target when current target is the native texture of the passed in texture
This commit is contained in:
parent
f2fff21762
commit
88cb4962cd
@ -1879,12 +1879,6 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
|
|||||||
if (!SDL_RenderTargetSupported(renderer)) {
|
if (!SDL_RenderTargetSupported(renderer)) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
}
|
}
|
||||||
if (texture == renderer->target) {
|
|
||||||
/* Nothing to do! */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
FlushRenderCommands(renderer); /* time to send everything to the GPU! */
|
|
||||||
|
|
||||||
/* texture == NULL is valid and means reset the target to the window */
|
/* texture == NULL is valid and means reset the target to the window */
|
||||||
if (texture) {
|
if (texture) {
|
||||||
@ -1901,6 +1895,13 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (texture == renderer->target) {
|
||||||
|
/* Nothing to do! */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
FlushRenderCommands(renderer); /* time to send everything to the GPU! */
|
||||||
|
|
||||||
SDL_LockMutex(renderer->target_mutex);
|
SDL_LockMutex(renderer->target_mutex);
|
||||||
|
|
||||||
if (texture && !renderer->target) {
|
if (texture && !renderer->target) {
|
||||||
|
Loading…
Reference in New Issue
Block a user