comparison src/video/SDL_video.c @ 216:e2a10730ae94

Fail if setting a video mode when requesting GL and can't get it.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 25 Oct 2001 06:22:38 +0000
parents 83018110dce8
children 4d24d5a660a8
comparison
equal deleted inserted replaced
215:041cd6816a05 216:e2a10730ae94
614 SDL_VideoSurface = NULL; /* In case it's freed by driver */ 614 SDL_VideoSurface = NULL; /* In case it's freed by driver */
615 mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags); 615 mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
616 if ( mode ) { /* Prevent resize events from mode change */ 616 if ( mode ) { /* Prevent resize events from mode change */
617 SDL_PrivateResize(mode->w, mode->h); 617 SDL_PrivateResize(mode->w, mode->h);
618 } 618 }
619 /* Sam - If we asked for an OpenGL mode, but didn't get it, fail */
620 if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
621 mode = NULL;
622 }
619 /* 623 /*
620 * rcg11292000 624 * rcg11292000
621 * If you try to set an SDL_OPENGL surface, and fail to find a 625 * If you try to set an SDL_OPENGL surface, and fail to find a
622 * matching visual, then the next call to SDL_SetVideoMode() 626 * matching visual, then the next call to SDL_SetVideoMode()
623 * will segfault, since we no longer point to a dummy surface, 627 * will segfault, since we no longer point to a dummy surface,