Chris Robinson : winex11: Use the specified format for GL Bitmaps.
Alexandre Julliard
julliard at winehq.org
Wed Oct 10 15:27:21 CDT 2007
Module: wine
Branch: master
Commit: d298b68f500ff88392d635f694a63e9a6886655f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d298b68f500ff88392d635f694a63e9a6886655f
Author: Chris Robinson <chris.kcat at gmail.com>
Date: Wed Oct 3 09:29:28 2007 -0700
winex11: Use the specified format for GL Bitmaps.
---
dlls/winex11.drv/opengl.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 226dfb9..588b3b6 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -984,21 +984,19 @@ Drawable create_glxpixmap(Display *display, XVisualInfo *vis, Pixmap parent)
}
-static XID create_bitmap_glxpixmap(X11DRV_PDEVICE *physDev)
+static XID create_bitmap_glxpixmap(X11DRV_PDEVICE *physDev, WineGLPixelFormat *fmt)
{
- GLXPixmap ret;
+ GLXPixmap ret = 0;
XVisualInfo *vis;
- XVisualInfo template;
- int num;
wine_tsx11_lock();
- /* Retrieve the visualid from our main visual which is the only visual we can use */
- template.visualid = XVisualIDFromVisual(visual);
- vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
-
- ret = pglXCreateGLXPixmap(gdi_display, vis, physDev->bitmap->pixmap);
- XFree(vis);
+ vis = pglXGetVisualFromFBConfig(gdi_display, fmt->fbconfig);
+ if(vis) {
+ if(vis->depth == physDev->bitmap->pixmap_depth)
+ ret = pglXCreateGLXPixmap(gdi_display, vis, physDev->bitmap->pixmap);
+ XFree(vis);
+ }
wine_tsx11_unlock();
TRACE("return %lx\n", ret);
return ret;
@@ -1466,7 +1464,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev,
return FALSE;
}
- physDev->bitmap->glxpixmap = create_bitmap_glxpixmap(physDev);
+ physDev->bitmap->glxpixmap = create_bitmap_glxpixmap(physDev, fmt);
if(!physDev->bitmap->glxpixmap) {
WARN("Couldn't create glxpixmap for pixel format %d\n", iPixelFormat);
return FALSE;
More information about the wine-cvs
mailing list