Fixed getting the renderer info when creating a window texture
This commit is contained in:
parent
ca61bf682a
commit
2d7cc6ded0
@ -264,7 +264,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
|
||||
/* Check to see if there's a specific driver requested */
|
||||
if (specific_accelerated_renderer) {
|
||||
renderer = SDL_CreateRenderer(window, hint, 0);
|
||||
if (!renderer || (SDL_GetRendererInfo(renderer, &info) == -1)) {
|
||||
if (!renderer || (SDL_GetRendererInfo(renderer, &info) < 0)) {
|
||||
if (renderer) {
|
||||
SDL_DestroyRenderer(renderer);
|
||||
}
|
||||
@ -297,10 +297,10 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
|
||||
SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL);
|
||||
|
||||
data->renderer = renderer;
|
||||
} else {
|
||||
if (SDL_GetRendererInfo(data->renderer, &info) == -1) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Free any old texture and pixel data */
|
||||
@ -3123,7 +3123,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window)
|
||||
#endif
|
||||
|
||||
if (attempt_texture_framebuffer) {
|
||||
if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) == -1) {
|
||||
if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) {
|
||||
/* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc),
|
||||
!!! FIXME: we probably need to clean this up so it doesn't interfere with
|
||||
!!! FIXME: a software fallback at the system level (can we blit to an
|
||||
|
Loading…
x
Reference in New Issue
Block a user