diff src/video/SDL_video.c @ 1491:cf23b92602aa

Don't crash if SDL_Flip() is called with an OpenGL mode set
author Sam Lantinga <slouken@libsdl.org>
date Thu, 09 Mar 2006 16:12:34 +0000
parents 5f52867ba65c
children 8d9bb0cf2c2a
line wrap: on
line diff
--- a/src/video/SDL_video.c	Thu Mar 09 15:11:15 2006 +0000
+++ b/src/video/SDL_video.c	Thu Mar 09 16:12:34 2006 +0000
@@ -1008,6 +1008,10 @@
 	SDL_VideoDevice *video = current_video;
 	SDL_VideoDevice *this = current_video;
 
+	if ( (screen->flags & (SDL_OPENGL | SDL_OPENGLBLIT)) == SDL_OPENGL ) {
+		SDL_SetError("OpenGL active, use SDL_GL_SwapBuffers()");
+		return;
+	}
 	if ( screen == SDL_ShadowSurface ) {
 		/* Blit the shadow surface using saved mapping */
 		SDL_Palette *pal = screen->format->palette;