Skip to content

Commit

Permalink
Fix a crash if an OpenGL video mode can't be set.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 4, 2001
1 parent f33a7fd commit abdc7da
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/video/SDL_video.c
Expand Up @@ -615,11 +615,12 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
if ( mode ) { /* Prevent resize events from mode change */
SDL_PrivateResize(mode->w, mode->h);
}
/* Sam - If we asked for an OpenGL mode, but didn't get it, fail */
if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {

/* Sam - If we asked for OpenGL mode, and didn't get it, fail */
if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
mode = NULL;
}
}
}
/*
* rcg11292000
* If you try to set an SDL_OPENGL surface, and fail to find a
Expand Down

0 comments on commit abdc7da

Please sign in to comment.