filename | src/drivers/video_glx.c |
changeset | 863:a5e5310061e2 |
prev | 806:6ef1ce4a9dbc |
next | 982:2d6b3f29f878 |
author | nkeynes |
date | Wed Oct 29 23:51:58 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Use regparam calling conventions for all functions called from translated code, along with a few other high-use functions. Can probably extend this to all functions, but as it is this is a nice performance boost |
file | annotate | diff | log | raw |
1.1 --- a/src/drivers/video_glx.c Fri Aug 08 00:17:57 2008 +00001.2 +++ b/src/drivers/video_glx.c Wed Oct 29 23:51:58 2008 +00001.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_BUILD1.9 + /* fbconfig is broken on at least the 10.5 GLX implementation */1.10 + glx_fbconfig_supported = FALSE;1.11 +#else1.12 glx_fbconfig_supported = (glx_version >= 103 ||1.13 isServerGLXExtensionSupported(display, screen,1.14 "GLX_SGIX_fbconfig") );1.15 +#endif1.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.31 @@ -133,7 +139,7 @@1.32 }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;
.