Search
lxdream.org :: lxdream/src/drivers/video_glx.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_glx.c
changeset 863:a5e5310061e2
prev806:6ef1ce4a9dbc
next982:2d6b3f29f878
author nkeynes
date Sun Sep 28 01:09:51 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Initial shadow volume implementation for opaque polygons (stencil isn't quite
right, but we get some kind of shadows now)
file annotate diff log raw
1.1 --- a/src/drivers/video_glx.c Fri Aug 08 00:17:57 2008 +0000
1.2 +++ b/src/drivers/video_glx.c Sun Sep 28 01:09:51 2008 +0000
1.3 @@ -96,19 +96,25 @@
1.4 if( result != False ) {
1.5 glx_version = (major*100) + minor;
1.6 }
1.7 -
1.8 +#ifdef APPLE_BUILD
1.9 + /* fbconfig is broken on at least the 10.5 GLX implementation */
1.10 + glx_fbconfig_supported = FALSE;
1.11 +#else
1.12 glx_fbconfig_supported = (glx_version >= 103 ||
1.13 isServerGLXExtensionSupported(display, screen,
1.14 "GLX_SGIX_fbconfig") );
1.15 +#endif
1.16 glx_pbuffer_supported = (glx_version >= 103 ||
1.17 isServerGLXExtensionSupported(display, screen,
1.18 "GLX_SGIX_pbuffer") );
1.19 +// glx_fbconfig_supported = FALSE;
1.20 if( glx_fbconfig_supported ) {
1.21 int nelem;
1.22 int fb_attribs[] = { GLX_DRAWABLE_TYPE,
1.23 GLX_PBUFFER_BIT|GLX_WINDOW_BIT,
1.24 GLX_RENDER_TYPE, GLX_RGBA_BIT,
1.25 - GLX_DEPTH_SIZE, 24, 0 };
1.26 + GLX_DEPTH_SIZE, 24,
1.27 + GLX_STENCIL_SIZE, 8, 0 };
1.28 GLXFBConfig *configs = glXChooseFBConfig( display, screen,
1.29 fb_attribs, &nelem );
1.30
1.31 @@ -133,7 +139,7 @@
1.32 }
1.33
1.34 if( !glx_fbconfig_supported ) {
1.35 - int attribs[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, 0 };
1.36 + int attribs[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, 0 };
1.37 glx_visual = glXChooseVisual( display, screen, attribs );
1.38 if( glx_visual == NULL ) {
1.39 /* Try the 16-bit fallback here too */
1.40 @@ -262,6 +268,12 @@
1.41 */
1.42 static void glx_pbuffer_init( display_driver_t driver )
1.43 {
1.44 + GLint stencil_bits = 0;
1.45 +
1.46 + /* Retrieve the number of stencil bits */
1.47 + glGetIntegerv( GL_STENCIL_BITS, &stencil_bits );
1.48 + driver->capabilities.stencil_bits = stencil_bits;
1.49 +
1.50 glGenTextures( 1, &glx_pbuffer_texture );
1.51 driver->create_render_buffer = glx_pbuffer_create_render_buffer;
1.52 driver->destroy_render_buffer = glx_pbuffer_destroy_render_buffer;
.