mirror of https://github.com/snes9xgit/snes9x.git
GTK+: GL: Trap X11 errors on context creation.
This commit is contained in:
parent
19f03c44de
commit
dd4614dada
|
@ -30,6 +30,18 @@
|
|||
#define GDK_IS_X11_DISPLAY(display) true
|
||||
#define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window)
|
||||
|
||||
inline void gdk_x11_display_error_trap_push(GdkDisplay *dpy)
|
||||
{
|
||||
gdk_error_trap_push();
|
||||
}
|
||||
|
||||
inline void gdk_x11_display_error_trap_pop_ignored(GdkDisplay *dpy)
|
||||
{
|
||||
if (gdk_error_trap_pop())
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
inline void gdk_window_get_geometry (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
|
|
|
@ -75,7 +75,7 @@ bool GTKGLXContext::attach (GtkWidget *widget)
|
|||
return false;
|
||||
}
|
||||
fbconfig = fbconfigs[0];
|
||||
XFree (fbconfigs);
|
||||
XFree(fbconfigs);
|
||||
|
||||
vi = glXGetVisualFromFBConfig (display, fbconfig);
|
||||
|
||||
|
@ -107,10 +107,12 @@ bool GTKGLXContext::create_context ()
|
|||
|
||||
const char *extensions = glXQueryExtensionsString (display, screen);
|
||||
|
||||
gdk_x11_display_error_trap_push(gdk_display);
|
||||
if (strstr (extensions, "GLX_ARB_create_context"))
|
||||
context = glXCreateContextAttribsARB (display, fbconfig, NULL, True, context_attribs);
|
||||
if (!context)
|
||||
context = glXCreateNewContext (display, fbconfig, GLX_RGBA_TYPE, NULL, True);
|
||||
gdk_x11_display_error_trap_pop_ignored(gdk_display);
|
||||
|
||||
if (!context)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue