[PATCH] winemac.drv: Don't bother storing the OpenGL version.

Charles Davis cdavis5x at gmail.com
Mon Feb 15 02:49:02 CST 2016


We never use it outside this function anyway. (In fact, all we use it
for is printing the OpenGL version supported by the main display's
renderer, which may not be accurate on >10.6.)

Signed-off-by: Charles Davis <cdavis5x at gmail.com>
---
 dlls/winemac.drv/opengl.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index a6f1440..ab79a82 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -44,7 +44,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
 
 
 struct gl_info {
-    char *glVersion;
     char *glExtensions;
 
     char wglExtensions[4096];
@@ -1259,9 +1258,6 @@ static BOOL init_gl_info(void)
         return FALSE;
     }
 
-    str = (const char*)opengl_funcs.gl.p_glGetString(GL_VERSION);
-    gl_info.glVersion = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
-    strcpy(gl_info.glVersion, str);
     str = (const char*)opengl_funcs.gl.p_glGetString(GL_EXTENSIONS);
     length = strlen(str) + sizeof(legacy_extensions);
     if (allow_vsync)
@@ -1274,9 +1270,10 @@ static BOOL init_gl_info(void)
 
     opengl_funcs.gl.p_glGetIntegerv(GL_MAX_VIEWPORT_DIMS, gl_info.max_viewport_dims);
 
-    TRACE("GL version   : %s\n", gl_info.glVersion);
+    str = (const char*)opengl_funcs.gl.p_glGetString(GL_VERSION);
+    sscanf(str, "%u.%u", &gl_info.max_major, &gl_info.max_minor);
+    TRACE("GL version   : %s\n", str);
     TRACE("GL renderer  : %s\n", opengl_funcs.gl.p_glGetString(GL_RENDERER));
-    sscanf(gl_info.glVersion, "%u.%u", &gl_info.max_major, &gl_info.max_minor);
 
     CGLSetCurrentContext(old_context);
     CGLReleaseContext(context);
-- 
2.7.1




More information about the wine-patches mailing list