[PATCH] winemac.drv: Advertise some legacy WGL extensions in the GL_EXTENSIONS string.
Charles Davis
cdavis5x at gmail.com
Tue Jul 23 22:26:30 CDT 2013
---
dlls/winemac.drv/opengl.c | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index fb294d1..4af6f23 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -104,6 +104,7 @@ static void (*pglCopyColorTable)(GLenum target, GLenum internalformat, GLint x,
static void (*pglCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
static void (*pglFlush)(void);
static void (*pglFlushRenderAPPLE)(void);
+static GLubyte *(*pglGetString)(GLenum name);
static void (*pglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, void *pixels);
static void (*pglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -1226,8 +1227,10 @@ static BOOL init_gl_info(void)
gl_info.glVersion = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
strcpy(gl_info.glVersion, str);
str = (const char*)opengl_funcs.gl.p_glGetString(GL_EXTENSIONS);
- gl_info.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
+ gl_info.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str) +
+ sizeof(" WGL_EXT_extensions_string WGL_EXT_swap_control"));
strcpy(gl_info.glExtensions, str);
+ strcat(gl_info.glExtensions, " WGL_EXT_extensions_string WGL_EXT_swap_control");
opengl_funcs.gl.p_glGetIntegerv(GL_MAX_VIEWPORT_DIMS, gl_info.max_viewport_dims);
@@ -1516,6 +1519,26 @@ static void macdrv_glFlush(void)
/**********************************************************************
+ * macdrv_glGetString
+ *
+ * Hook into glGetString in order to return some legacy WGL extensions
+ * that couldn't be advertised via the standard
+ * WGL_ARB_extensions_string mechanism. Some programs, especially
+ * older ones, expect to find certain older extensions, such as
+ * WGL_EXT_extensions_string itself, in the standard GL extensions
+ * string, and won't query any other WGL extensions unless they find
+ * that particular extension there.
+ */
+static const GLubyte *macdrv_glGetString(GLenum name)
+{
+ if (name == GL_EXTENSIONS && gl_info.glExtensions)
+ return (const GLubyte *)gl_info.glExtensions;
+ else
+ return pglGetString(name);
+}
+
+
+/**********************************************************************
* macdrv_glReadPixels
*
* Hook into glReadPixels as part of the implementation of
@@ -3054,6 +3077,7 @@ static BOOL init_opengl(void)
#define REDIRECT(func) \
do { p##func = opengl_funcs.gl.p_##func; opengl_funcs.gl.p_##func = macdrv_##func; } while(0)
REDIRECT(glCopyPixels);
+ REDIRECT(glGetString);
REDIRECT(glReadPixels);
REDIRECT(glViewport);
if (skip_single_buffer_flushes)
--
1.7.5.4
More information about the wine-patches
mailing list