src/video/wincommon/SDL_wingl.c
changeset 1754 c67921b517c3
parent 1737 eacc5bc01d1c
child 1757 ac282d472a2e
equal deleted inserted replaced
1753:5b3bb08e7dd8 1754:c67921b517c3
   175 	int i;
   175 	int i;
   176 	unsigned int matching;
   176 	unsigned int matching;
   177 	int iAttribs[64];
   177 	int iAttribs[64];
   178 	int *iAttr;
   178 	int *iAttr;
   179 	float fAttribs[1] = { 0 };
   179 	float fAttribs[1] = { 0 };
       
   180 	const GLubyte *(*glGetStringFunc)(GLenum);
   180 	const char *wglext;
   181 	const char *wglext;
   181 
   182 
   182 	/* load the gl driver from a default path */
   183 	/* load the gl driver from a default path */
   183 	if ( ! this->gl_config.driver_loaded ) {
   184 	if ( ! this->gl_config.driver_loaded ) {
   184 		/* no driver has been loaded, use default (ourselves) */
   185 		/* no driver has been loaded, use default (ourselves) */
   336 
   337 
   337 	/* Vsync control under Windows.  Checking glGetString here is
   338 	/* Vsync control under Windows.  Checking glGetString here is
   338 	 * somewhat a documented and reliable hack - it was originally
   339 	 * somewhat a documented and reliable hack - it was originally
   339 	 * as a feature added by mistake, but since so many people rely
   340 	 * as a feature added by mistake, but since so many people rely
   340 	 * on it, it will not be removed.  strstr should be safe here.*/
   341 	 * on it, it will not be removed.  strstr should be safe here.*/
   341 	wglext = (const char *)this->glGetString(GL_EXTENSIONS);
   342 	glGetStringFunc = WIN_GL_GetProcAddress(this, "glGetString");
   342 	if ( !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
   343 	if ( glGetStringFunc ) {
       
   344 		wglext = (const char *)this->glGetString(GL_EXTENSIONS);
       
   345 	} else {
       
   346 		/* Uh oh, something is seriously wrong here... */
       
   347 		wglext = NULL;
       
   348 	}
       
   349 	if ( !wglext || !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
   343 		this->gl_data->wglSwapIntervalEXT = NULL;
   350 		this->gl_data->wglSwapIntervalEXT = NULL;
   344 		this->gl_data->wglGetSwapIntervalEXT = NULL;
   351 		this->gl_data->wglGetSwapIntervalEXT = NULL;
   345 	}
   352 	}
   346 	if ( this->gl_config.swap_control >= 0 ) {
   353 	if ( this->gl_config.swap_control >= 0 ) {
   347 		if ( this->gl_data->wglSwapIntervalEXT ) {
   354 		if ( this->gl_data->wglSwapIntervalEXT ) {