[PATCH 1/2] wgl: ignore fbconfigs which are window drawable but which lack a visual.

Roderick Colenbrander thunderbird2k at gmail.com
Tue Apr 20 05:13:25 CDT 2010


---
 dlls/winex11.drv/opengl.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 94fbb1e..a3c4f6b 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -992,6 +992,21 @@ static WineGLPixelFormat *get_formats(Display *display, int *size_ret, int *onsc
                     onscreen_size++;
                 }
             } else if(run && !visinfo) {
+                int window_drawable=0;
+                pglXGetFBConfigAttrib(gdi_display, cfgs[i], GLX_DRAWABLE_TYPE, &window_drawable);
+
+                /* Recent Nvidia drivers and DRI drivers offer window drawable formats without a visual.
+                 * This are formats like 16-bit rgb on a 24-bit desktop. In order to support these formats
+                 * onscreen we would have to use glXCreateWindow instead of XCreateWindow. Further it will
+                 * likely make our child window opengl rendering more complicated since likely you can't use
+                 * XCopyArea on a GLX Window.
+                 * For now ignore fbconfigs which are window drawable but lack a visual. */
+                if(window_drawable & GLX_WINDOW_BIT)
+                {
+                    TRACE("Skipping FBCONFIG_ID 0x%x as an offscreen format because it is window_drawable\n", fmt_id);
+                    continue;
+                }
+
                 TRACE("Found offscreen format FBCONFIG_ID 0x%x corresponding to iPixelFormat %d at GLX index %d\n", fmt_id, size+1, i);
                 list[size].iPixelFormat = size+1; /* The index starts at 1 */
                 list[size].fbconfig = cfgs[i];
-- 
1.6.3.3




More information about the wine-patches mailing list