[PATCH] winex11.drv: Advertise some legacy WGL extensions in the GL_EXTENSIONS string (try 4).
Charles Davis
cdavis5x at gmail.com
Mon Aug 12 16:07:05 CDT 2013
Try 4: Fix build warning.
---
dlls/winex11.drv/opengl.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 9d58861..e84b960 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -396,9 +396,11 @@ static void (*pglXCopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x,
/* Standard OpenGL */
static void (*pglFinish)(void);
static void (*pglFlush)(void);
+static const GLubyte *(*pglGetString)(GLenum name);
static void wglFinish(void);
static void wglFlush(void);
+static const GLubyte *wglGetString(GLenum name);
/* check if the extension is present in the list */
static BOOL has_extension( const char *list, const char *ext )
@@ -422,6 +424,8 @@ static int GLXErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
static BOOL X11DRV_WineGL_InitOpenglInfo(void)
{
+ static const char legacy_extensions[] = " WGL_EXT_extensions_string WGL_EXT_swap_control";
+
int screen = DefaultScreen(gdi_display);
Window win = 0, root = 0;
const char *gl_renderer;
@@ -473,8 +477,10 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
gl_renderer = (const char *)opengl_funcs.gl.p_glGetString(GL_RENDERER);
WineGLInfo.glVersion = (const char *) opengl_funcs.gl.p_glGetString(GL_VERSION);
str = (const char *) opengl_funcs.gl.p_glGetString(GL_EXTENSIONS);
- WineGLInfo.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str)+1);
+ WineGLInfo.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str)+
+ sizeof(legacy_extensions));
strcpy(WineGLInfo.glExtensions, str);
+ strcat(WineGLInfo.glExtensions, legacy_extensions);
/* Get the common GLX version supported by GLX client and server ( major/minor) */
pglXQueryVersion(gdi_display, &WineGLInfo.glxVersion[0], &WineGLInfo.glxVersion[1]);
@@ -581,6 +587,7 @@ static BOOL has_opengl(void)
do { p##func = opengl_funcs.gl.p_##func; opengl_funcs.gl.p_##func = w##func; } while(0)
REDIRECT( glFinish );
REDIRECT( glFlush );
+ REDIRECT( glGetString );
#undef REDIRECT
pglXGetProcAddressARB = wine_dlsym(opengl_handle, "glXGetProcAddressARB", NULL, 0);
@@ -1927,6 +1934,13 @@ static void wglFlush(void)
if (escape.gl_drawable) ExtEscape( ctx->hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
}
+static const GLubyte *wglGetString(GLenum name)
+{
+ if (name == GL_EXTENSIONS && WineGLInfo.glExtensions)
+ return (const GLubyte *)WineGLInfo.glExtensions;
+ return pglGetString(name);
+}
+
/***********************************************************************
* X11DRV_wglCreateContextAttribsARB
*/
--
1.7.5.4
More information about the wine-patches
mailing list