changeset 423:d1565c52ded5

More correct error reported when calling SDL_GL_LoadLibrary() without prior call to SDL_Init().
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 10 Jul 2002 05:18:09 +0000
parents b1b9ee41be70
children b82518082828
files src/video/SDL_video.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/SDL_video.c	Wed Jul 03 04:54:55 2002 +0000
+++ b/src/video/SDL_video.c	Wed Jul 10 05:18:09 2002 +0000
@@ -1299,10 +1299,14 @@
 	int retval;
 
 	retval = -1;
-	if ( video && video->GL_LoadLibrary ) {
-		retval = video->GL_LoadLibrary(this, path);
+	if ( video == NULL ) {
+		SDL_SetError("Video subsystem has not been initialized");
 	} else {
-		SDL_SetError("No dynamic GL support in video driver");
+		if ( video->GL_LoadLibrary ) {
+			retval = video->GL_LoadLibrary(this, path);
+		} else {
+			SDL_SetError("No dynamic GL support in video driver");
+		}
 	}
 	return(retval);
 }