mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-11-04 09:44:35 +00:00 
			
		
		
		
	Fixed getting the renderer info when creating a window texture
This commit is contained in:
		@@ -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 */
 | 
					        /* Check to see if there's a specific driver requested */
 | 
				
			||||||
        if (specific_accelerated_renderer) {
 | 
					        if (specific_accelerated_renderer) {
 | 
				
			||||||
            renderer = SDL_CreateRenderer(window, hint, 0);
 | 
					            renderer = SDL_CreateRenderer(window, hint, 0);
 | 
				
			||||||
            if (!renderer || (SDL_GetRendererInfo(renderer, &info) == -1)) {
 | 
					            if (!renderer || (SDL_GetRendererInfo(renderer, &info) < 0)) {
 | 
				
			||||||
                if (renderer) {
 | 
					                if (renderer) {
 | 
				
			||||||
                    SDL_DestroyRenderer(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);
 | 
					        SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        data->renderer = renderer;
 | 
					        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 */
 | 
					    /* Free any old texture and pixel data */
 | 
				
			||||||
@@ -3123,7 +3123,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window)
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (attempt_texture_framebuffer) {
 | 
					        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: 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:  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
 | 
					                   !!! FIXME:  a software fallback at the system level (can we blit to an
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user