st/wgl: dummy implementation of wgl swapinterval extension

Required as some applications
retrieve and call these functions regardless of the fact that we
don't advertise the extension and further more the results of
wglGetProcAddress are NULL.
This commit is contained in:
Keith Whitwell
2009-07-01 17:34:38 +01:00
parent 1c04731b87
commit 6c913411d3
4 changed files with 63 additions and 0 deletions
@@ -27,6 +27,7 @@ if env['platform'] in ['windows']:
'shared/stw_framebuffer.c',
'shared/stw_pixelformat.c',
'shared/stw_extensionsstring.c',
'shared/stw_extswapinterval.c',
'shared/stw_getprocaddress.c',
'shared/stw_arbpixelformat.c',
'shared/stw_tls.c',
@@ -38,6 +38,7 @@ static const char *stw_extension_string =
"WGL_ARB_extensions_string "
"WGL_ARB_multisample "
"WGL_ARB_pixel_format "
"WGL_EXT_swap_interval "
"WGL_EXT_extensions_string";
@@ -0,0 +1,57 @@
/**************************************************************************
*
* Copyright 2009 VMware, Inc.
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <windows.h>
#define WGL_WGLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/wglext.h>
#include "util/u_debug.h"
/* A dummy implementation of this extension.
*
* Required as some applications retrieve and call these functions
* regardless of the fact that we don't advertise the extension and
* further more the results of wglGetProcAddress are NULL.
*/
WINGDIAPI BOOL APIENTRY
wglSwapIntervalEXT(int interval)
{
(void) interval;
debug_printf("%s: %d\n", __FUNCTION__, interval);
return TRUE;
}
WINGDIAPI int APIENTRY
wglGetSwapIntervalEXT(void)
{
return 0;
}
@@ -56,6 +56,10 @@ static const struct stw_extension_entry stw_extension_entries[] = {
/* WGL_EXT_extensions_string */
STW_EXTENSION_ENTRY( wglGetExtensionsStringEXT ),
/* WGL_EXT_swap_interval */
STW_EXTENSION_ENTRY( wglGetSwapIntervalEXT ),
STW_EXTENSION_ENTRY( wglSwapIntervalEXT ),
{ NULL, NULL }
};