[PATCH 2/5] winex11.drv: Complain a bit about missing s3tc support.

Henri Verbeet hverbeet at codeweavers.com
Mon Sep 6 15:18:53 CDT 2010


Note that personally I don't think it's appropriate for "winediag" to abuse
the __WINE_DBCL_ERR debug class for diagnostic messages.
---
 dlls/winex11.drv/opengl.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 3869619..76f45fe 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -293,6 +293,24 @@ static int GLXErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
     return 1;
 }
 
+static BOOL x11drv_has_extension(const char *extension_string, const char *extension)
+{
+    const char *e, *p, *q;
+    size_t len;
+
+    for (e = extension_string; e; e = q)
+    {
+        if (!(p = strstr(e, extension)))
+            return FALSE;
+
+        len = (q = strchr(p, ' ')) ? q - p : strlen(p);
+        if (len == strlen(extension) && !memcmp(p, extension, len))
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
 static BOOL infoInitialized = FALSE;
 static BOOL X11DRV_WineGL_InitOpenglInfo(void)
 {
@@ -399,6 +417,14 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
         if(!strcmp(gl_renderer, "Software Rasterizer") || !strcmp(gl_renderer, "Mesa X11"))
             ERR_(winediag)("The Mesa OpenGL driver is using software rendering, most likely your OpenGL drivers haven't been installed correctly\n");
     }
+
+    if (!x11drv_has_extension(WineGLInfo.glExtensions, "GL_EXT_texture_compression_s3tc"))
+    {
+        ERR_(winediag)("GL_EXT_texture_compression_s3tc is not supported by the OpenGL driver.\n");
+        ERR_(winediag)("Several applications, games in particular, depend on this extension being\n");
+        ERR_(winediag)("supported and may not work correctly without it.\n");
+    }
+
     ret = TRUE;
 
 done:
-- 
1.7.1




More information about the wine-patches mailing list