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;
}