src/video/xbios/SDL_xbios.c
changeset 991 12b13601a544
parent 989 475166d13b44
child 992 0324ce32b2d9
--- a/src/video/xbios/SDL_xbios.c	Fri Nov 26 16:13:24 2004 +0000
+++ b/src/video/xbios/SDL_xbios.c	Fri Nov 26 16:16:50 2004 +0000
@@ -411,6 +411,10 @@
 	/* Init chunky to planar routine */
 	SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
 
+#ifdef HAVE_OPENGL
+	SDL_AtariGL_InitPointers(this);
+#endif
+
 	/* We're done! */
 	return(0);
 }
@@ -431,7 +435,9 @@
 	int i;
 
 #ifdef HAVE_OPENGL
-	SDL_AtariGL_Quit(this);
+	if (gl_active) {
+		SDL_AtariGL_Quit(this);
+	}
 #endif
 
 	for (i=0;i<2;i++) {
@@ -876,12 +882,12 @@
 
 static void XBIOS_GL_SwapBuffers(_THIS)
 {
-	if (gl_ctx == NULL) {
-		return;
+	if (gl_active) {
+		gl_copyshadow(this, this->screen);
+		gl_convert(this, this->screen);
+		XBIOS_FlipHWSurface(this, this->screen);
+		SDL_AtariGL_MakeCurrent(this);
 	}
-
-	XBIOS_FlipHWSurface(this, this->screen);
-	SDL_AtariGL_MakeCurrent(this);
 }
 
 #endif