1.1 --- a/src/drivers/video_x11.c Thu Oct 11 08:20:38 2007 +0000
1.2 +++ b/src/drivers/video_x11.c Thu Oct 11 11:09:10 2007 +0000
1.5 - * $Id: video_x11.c,v 1.16 2007-10-11 08:20:38 nkeynes Exp $
1.6 + * $Id: video_x11.c,v 1.17 2007-10-11 11:09:10 nkeynes Exp $
1.8 * Shared functions for all X11-based display drivers.
1.14 + XVisualInfo query;
1.15 + int query_items = 1;
1.16 + query.visualid = XVisualIDFromVisual(DefaultVisual(video_x11_display, screen));
1.17 + visual = XGetVisualInfo(video_x11_display, VisualIDMask, &query, &query_items );
1.20 /* Find ourselves a nice visual */
1.21 - visual = glXChooseVisual( video_x11_display,
1.24 + //visual = glXChooseVisual( video_x11_display,
1.26 + // visual_attrs );
1.27 if( visual == NULL ) {
1.28 ERROR( "Unable to obtain a compatible visual" );
1.30 @@ -112,14 +118,13 @@
1.31 ERROR( "Unable to obtain a GLX Context. Possibly your system is broken in some small, undefineable way" );
1.37 /* Ok, all good so far. Unfortunately the visual we need to use will
1.38 * almost certainly be different from the one our frame is using. Which
1.39 * means we have to jump through the following hoops to create a
1.40 * child window with the appropriate settings.
1.43 win_attrs.event_mask = 0;
1.44 win_attrs.colormap = XCreateColormap( video_x11_display,
1.45 RootWindowOfScreen(video_x11_screen),
1.46 @@ -132,15 +137,18 @@
1.47 if( glx_window == None ) {
1.48 /* Hrm. Aww, no window? */
1.49 ERROR( "Unable to create GLX window" );
1.50 - glXDestroyContext( video_x11_display, glx_context );
1.51 + glXDestroyContext( video_x11_display, gtl_context );
1.52 if( win_attrs.colormap )
1.53 XFreeColormap( video_x11_display, win_attrs.colormap );
1.56 XMapRaised( video_x11_display, glx_window );
1.60 + glx_window = video_x11_window;
1.62 /* And finally set the window to be the active drawing area */
1.63 - if( glXMakeCurrent( video_x11_display, video_x11_window, glx_context ) == False ) {
1.64 + if( glXMakeCurrent( video_x11_display, glx_window, glx_context ) == False ) {
1.65 /* Ok you have _GOT_ to be kidding me */
1.66 ERROR( "Unable to prepare GLX window for drawing" );
1.67 XDestroyWindow( video_x11_display, glx_window );