Commit 81b7208e authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Do not do any GLX calls on a display that does not support GLX.

parent 89d4472d
...@@ -147,17 +147,21 @@ static void create_desktop( const char *geometry ) ...@@ -147,17 +147,21 @@ static void create_desktop( const char *geometry )
XVisualInfo *vi = NULL; XVisualInfo *vi = NULL;
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
BOOL dblbuf_visual; BOOL dblbuf_visual;
int err_base, evt_base;
/* Get in wine.ini if the desktop window should have a double-buffered visual or not */
dblbuf_visual = PROFILE_GetWineIniBool( "x11drv", "DesktopDoubleBuffered", 0 ); /* Get in wine.ini if the desktop window should have a double-buffered visual or not.
if (dblbuf_visual) { But first, test if OpenGL is even supported on the display ! */
int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None}; if (glXQueryExtension(display, &err_base, &evt_base) == True) {
dblbuf_visual = PROFILE_GetWineIniBool( "x11drv", "DesktopDoubleBuffered", 0 );
ENTER_GL(); if (dblbuf_visual) {
vi = glXChooseVisual(display, DefaultScreen(display), dblBuf); int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None};
win_attr.colormap = XCreateColormap(display, RootWindow(display,vi->screen),
vi->visual, AllocNone); ENTER_GL();
LEAVE_GL(); vi = glXChooseVisual(display, DefaultScreen(display), dblBuf);
win_attr.colormap = XCreateColormap(display, RootWindow(display,vi->screen),
vi->visual, AllocNone);
LEAVE_GL();
}
} }
#endif /* HAVE_OPENGL */ #endif /* HAVE_OPENGL */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment