src/video/x11/SDL_x11gl.c
changeset 655 9c42ee1b7d77
parent 646 0f2029a70548
child 656 864e2d2a9a55
     1.1 --- a/src/video/x11/SDL_x11gl.c	Tue Jul 22 14:01:21 2003 +0000
     1.2 +++ b/src/video/x11/SDL_x11gl.c	Tue Jul 22 15:10:06 2003 +0000
     1.3 @@ -122,6 +122,16 @@
     1.4  		attribs[i++] = GLX_STEREO;
     1.5  		attribs[i++] = this->gl_config.stereo;
     1.6  	}
     1.7 +	
     1.8 +	if( this->gl_config.sample_buffers ) {
     1.9 +		attribs[i++] = GLX_SAMPLE_BUFFERS_ARB;
    1.10 +		attribs[i++] = this->gl_config.sample_buffers;
    1.11 +	}
    1.12 +	
    1.13 +	if( this->gl_config.samples ) {
    1.14 +		attribs[i++] = GLX_SAMPLES_ARB;
    1.15 +		attribs[i++] = this->gl_config.samples;
    1.16 +	}
    1.17  
    1.18  #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */
    1.19  	attribs[i++] = GLX_X_VISUAL_TYPE;
    1.20 @@ -229,7 +239,7 @@
    1.21  
    1.22  #ifdef HAVE_OPENGL
    1.23  
    1.24 -static int ExtensionSupported(const char *extension, const char *all_extensions)
    1.25 +static int ExtensionSupported(const char *extension)
    1.26  {
    1.27  	const GLubyte *extensions = NULL;
    1.28  	const GLubyte *start;
    1.29 @@ -266,7 +276,6 @@
    1.30  int X11_GL_MakeCurrent(_THIS)
    1.31  {
    1.32  	int retval;
    1.33 -	const char *glx_extensions;
    1.34  	
    1.35  	retval = 0;
    1.36  	if ( ! this->gl_data->glXMakeCurrent(GFX_Display,
    1.37 @@ -276,7 +285,6 @@
    1.38  	}
    1.39  	XSync( GFX_Display, False );
    1.40  
    1.41 -	
    1.42  	/* 
    1.43  	 * The context is now current, check for glXReleaseBuffersMESA() 
    1.44  	 * extension. If extension is _not_ supported, destroy the pointer 
    1.45 @@ -296,10 +304,10 @@
    1.46  	 * 
    1.47  	 */
    1.48  	
    1.49 -	glx_extensions = this->gl_data->glXQueryExtensionsString(GFX_Display, SDL_Screen);
    1.50 -	if (!ExtensionSupported("glXReleaseBuffersMESA", glx_extensions)) this->gl_data->glXReleaseBuffersMESA = NULL;
    1.51 -	
    1.52 -	
    1.53 +	if ( ! ExtensionSupported("glXReleaseBuffersMESA") ) {
    1.54 +		this->gl_data->glXReleaseBuffersMESA = NULL;
    1.55 +	}
    1.56 +
    1.57  	/* More Voodoo X server workarounds... Grr... */
    1.58  	SDL_Lock_EventThread();
    1.59  	X11_CheckDGAMouse(this);
    1.60 @@ -354,6 +362,12 @@
    1.61  	    case SDL_GL_STEREO:
    1.62  		glx_attrib = GLX_STEREO;
    1.63  		break;
    1.64 + 	    case SDL_GL_SAMPLE_BUFFERS:
    1.65 + 		glx_attrib = GLX_SAMPLE_BUFFERS_ARB;
    1.66 + 		break;
    1.67 + 	    case SDL_GL_SAMPLES:
    1.68 + 		glx_attrib = GLX_SAMPLES_ARB;
    1.69 + 		break;
    1.70  	    default:
    1.71  		return(-1);
    1.72  	}