diff src/video/ggi/SDL_ggivideo.c @ 17:4f22a992f5e9

Fixed crash in GGI detection
author Sam Lantinga <slouken@lokigames.com>
date Thu, 10 May 2001 18:10:19 +0000
parents 74212992fb08
children e8157fcb3114
line wrap: on
line diff
--- a/src/video/ggi/SDL_ggivideo.c	Thu May 10 18:04:03 2001 +0000
+++ b/src/video/ggi/SDL_ggivideo.c	Thu May 10 18:10:19 2001 +0000
@@ -75,11 +75,13 @@
 static int GGI_Available(void)
 {
 	ggi_visual_t *vis;
-	
-	vis = ggiOpen(NULL);
-	if (vis != NULL) 
-	{
-		ggiClose(vis);
+
+	vis = NULL;
+	if (ggiInit() == 0) {
+		vis = ggiOpen(NULL);
+		if (vis != NULL) {
+			ggiClose(vis);
+		}
 	}
 	return (vis != NULL);
 }