summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/wgl
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-07-01 17:34:38 +0100
committerKeith Whitwell <[email protected]>2009-07-01 17:37:15 +0100
commit6c913411d39fd68eee1c1eeee7b6e81db9785fd1 (patch)
tree7822fce0fe247ecf5d1460a29e44575008b97b0b /src/gallium/state_trackers/wgl
parent1c04731b8721850b6abb12a43a3eec616b850e86 (diff)
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.
Diffstat (limited to 'src/gallium/state_trackers/wgl')
-rw-r--r--src/gallium/state_trackers/wgl/SConscript1
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_extensionsstring.c1
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_extswapinterval.c57
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c4
4 files changed, 63 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript
index 5bbcc7175f7..a0866574876 100644
--- a/src/gallium/state_trackers/wgl/SConscript
+++ b/src/gallium/state_trackers/wgl/SConscript
@@ -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',
diff --git a/src/gallium/state_trackers/wgl/shared/stw_extensionsstring.c b/src/gallium/state_trackers/wgl/shared/stw_extensionsstring.c
index 2660c591f9f..00514635aa0 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_extensionsstring.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_extensionsstring.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";
diff --git a/src/gallium/state_trackers/wgl/shared/stw_extswapinterval.c b/src/gallium/state_trackers/wgl/shared/stw_extswapinterval.c
new file mode 100644
index 00000000000..9eac6a1d09d
--- /dev/null
+++ b/src/gallium/state_trackers/wgl/shared/stw_extswapinterval.c
@@ -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;
+}
+
+
diff --git a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c
index 8cacbb89266..54cc0389059 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c
@@ -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 }
};