Dirty fix for the bad context bug.

Instead of fixing it, we're trapping the error and disabling 3D.
This commit is contained in:
yabause 2008-12-23 21:20:13 +00:00
parent 5d48cdbca9
commit 01b2c8076f
2 changed files with 16 additions and 7 deletions

View File

@ -22,6 +22,7 @@
#ifdef GTKGLEXT_AVAILABLE
#include <gdk/gdkgl.h>
#include <gdk/gdk.h>
// Localization
#include <libintl.h>
@ -127,13 +128,16 @@ examine_gl_config_attrib (GdkGLConfig *glconfig)
}
#endif
static bool
begin_opengl_region_gdk_3d( void) {
bool failed = false;
if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext)) {
return false;
}
gdk_error_trap_push();
failed = !gdk_gl_drawable_gl_begin(gldrawable, glcontext);
gdk_flush();
failed = failed | gdk_error_trap_pop();
if (failed) return false;
return true;
}

View File

@ -22,6 +22,7 @@
#ifdef GTKGLEXT_AVAILABLE
#include <gdk/gdkgl.h>
#include <gdk/gdk.h>
#include "../types.h"
#include "../render3D.h"
@ -126,10 +127,14 @@ examine_gl_config_attrib (GdkGLConfig *glconfig)
static bool
_oglrender_beginOpenGL( void) {
int failed = 0;
if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext)) {
return 0;
}
gdk_error_trap_push();
failed = !gdk_gl_drawable_gl_begin(gldrawable, glcontext);
gdk_flush();
failed = failed | gdk_error_trap_pop();
if (failed) return 0;
return 1;
}