new_surface = SDL_CreateRGBSurface(0, width, height, 32, 0,0,0, 0);
if (new_surface == NULL)
- Error(ERR_WARN, "SDL_CreateRGBSurface() failed: %s",
- SDL_GetError());
+ Error(ERR_WARN, "SDL_CreateRGBSurface() failed: %s", SDL_GetError());
}
else
{
#else
new_surface = SDL_SetVideoMode(width, height, video.depth, surface_flags);
+
+ if (new_surface == NULL)
+ Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError());
#endif
#if defined(TARGET_SDL2)
if (new_surface == NULL)
{
- /* switching display to fullscreen mode failed */
- Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError());
-
- /* do not try it again */
+ /* switching display to fullscreen mode failed -- do not try it again */
video.fullscreen_available = FALSE;
success = FALSE;
if (new_surface == NULL)
{
/* switching display to window mode failed -- should not happen */
- Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError());
success = FALSE;
}
src_bitmap->surface_masked : src_bitmap->surface),
&src_rect, real_dst_bitmap->surface, &dst_rect);
-#if defined(TARGET_SDL2)
if (dst_bitmap == window)
- {
- // SDL_UpdateWindowSurface(sdl_window);
- // SDL_UpdateWindowSurfaceRects(sdl_window, &dst_rect, 1);
UpdateScreen(&dst_rect);
- }
-#else
- if (dst_bitmap == window)
- {
- // SDL_UpdateRect(backbuffer->surface, dst_x, dst_y, width, height);
- UpdateScreen(&dst_rect);
- }
-#endif
}
void SDLBlitTexture(Bitmap *bitmap,