Search
lxdream.org :: lxdream :: r439:f0c7928c5914
lxdream 0.9.1
released Jun 29
Download Now
changeset439:f0c7928c5914
parent438:f4d7774967d1
child440:d9bd9b7a283f
authornkeynes
dateThu Oct 11 11:09:10 2007 +0000 (16 years ago)
Use the default visual (all we do is render onto the front buffer, so we don't really care what it is)
src/drivers/video_x11.c
1.1 --- a/src/drivers/video_x11.c Thu Oct 11 11:08:36 2007 +0000
1.2 +++ b/src/drivers/video_x11.c Thu Oct 11 11:09:10 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
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.7 *
1.8 * Shared functions for all X11-based display drivers.
1.9 *
1.10 @@ -97,10 +97,16 @@
1.11 return FALSE;
1.12 }
1.13
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.18 +
1.19 +
1.20 /* Find ourselves a nice visual */
1.21 - visual = glXChooseVisual( video_x11_display,
1.22 - screen,
1.23 - visual_attrs );
1.24 + //visual = glXChooseVisual( video_x11_display,
1.25 + // screen,
1.26 + // visual_attrs );
1.27 if( visual == NULL ) {
1.28 ERROR( "Unable to obtain a compatible visual" );
1.29 return FALSE;
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.32 return FALSE;
1.33 }
1.34 -
1.35 + #if 0
1.36
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.41 */
1.42 -#if 0
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.54 return FALSE;
1.55 }
1.56 XMapRaised( video_x11_display, glx_window );
1.57 -#endif
1.58 + #endif
1.59 +
1.60 + glx_window = video_x11_window;
1.61 +
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 );
.