st/wgl: dummy implementation of wgl swapinterval extension
authorKeith Whitwell <keithw@vmware.com>
Wed, 1 Jul 2009 16:34:38 +0000 (17:34 +0100)
committerKeith Whitwell <keithw@vmware.com>
Wed, 1 Jul 2009 16:37:15 +0000 (17:37 +0100)
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.

src/gallium/state_trackers/wgl/SConscript
src/gallium/state_trackers/wgl/shared/stw_extensionsstring.c
src/gallium/state_trackers/wgl/shared/stw_extswapinterval.c [new file with mode: 0644]
src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c

index 5bbcc7175f7f2e54533946f82f9ef252dd7aaf57..a086657487665dcd630b567fc8e02c08278280b4 100644 (file)
@@ -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',
index 2660c591f9ff9734a27c29567dec1037b352d3a2..00514635aa0492e9197431cd011bed991adc22b3 100644 (file)
@@ -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 (file)
index 0000000..9eac6a1
--- /dev/null
@@ -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;
+}
+
+
index 8cacbb89266a518ec5b64b86ce6b7aa72497acda..54cc0389059bb4b5137aeb8cf714768476993565 100644 (file)
@@ -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 }
 };