From 12fbaa83cfcd55445978b32ceb2fae3ffc501bcb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <slouken@libsdl.org>
Date: Thu, 25 Oct 2001 06:22:38 +0000
Subject: [PATCH] Fail if setting a video mode when requesting GL and can't get
 it.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40217
---
 src/video/SDL_video.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index a4ed09e9..89b1d2b7 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -616,6 +616,10 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 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) ) {
+		mode = NULL;
+	}
 	/*
 	 * rcg11292000
 	 * If you try to set an SDL_OPENGL surface, and fail to find a
-- 
2.18.1