[5/8] winex11.drv: Try to get an opengl visual with aux buffers
Stefan Dösinger
stefan at codeweavers.com
Wed Feb 28 10:19:25 CST 2007
-------------- next part --------------
From b4d34d6707152d97ccb81569fe7aa8cd7c620098 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Tue, 27 Feb 2007 15:53:43 +0100
Subject: [PATCH] winex11.drv: Try to get an opengl visual with aux buffers
Applications may profit from auxilliary buffers. Because we have to find
the visual at initialization time try to find a visual with aux buffers
first, if none is found fall back to the usual default visual without
aux buffers
---
dlls/winex11.drv/opengl.c | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index fdb92ae..9c1060a 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3083,33 +3083,44 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
XVisualInfo *X11DRV_setup_opengl_visual( Display *display )
{
XVisualInfo *visual = NULL;
- /* In order to support OpenGL or D3D, we require a double-buffered visual and stencil buffer support, */
- int dblBuf[] = {GLX_RGBA,GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_ALPHA_SIZE, 8, GLX_DOUBLEBUFFER, None};
+ /* In order to support OpenGL or D3D, we require a double-buffered visual and stencil buffer support,
+ * WineD3D and Some applications can make use of aux buffers
+ */
+ int dblBuf[] = {GLX_RGBA,GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_ALPHA_SIZE, 8, GLX_AUX_BUFFERS, 1, GLX_DOUBLEBUFFER, None};
if (!has_opengl()) return NULL;
wine_tsx11_lock();
visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf);
wine_tsx11_unlock();
if (visual == NULL) {
- /* fallback to 16 bits depth, no alpha */
- int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, GLX_DOUBLEBUFFER, None};
- WARN("Failed to get a visual with at least 24 bits depth\n");
+ /* Try without aux buffers */
+ int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_ALPHA_SIZE, 8, GLX_DOUBLEBUFFER, None};
+ WARN("Failed to get a visual with at least one aux buffer\n");
wine_tsx11_lock();
visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf2);
wine_tsx11_unlock();
if (visual == NULL) {
- /* fallback to no stencil */
- int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None};
- WARN("Failed to get a visual with at least 8 bits of stencil\n");
+ /* fallback to 16 bits depth, no alpha */
+ int dblBuf3[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, GLX_DOUBLEBUFFER, None};
+ WARN("Failed to get a visual with at least 24 bits depth\n");
wine_tsx11_lock();
- visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf2);
+ visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf3);
wine_tsx11_unlock();
if (visual == NULL) {
- /* This should only happen if we cannot find a match with a depth size 16 */
- FIXME("Failed to find a suitable visual\n");
- return visual;
+ /* fallback to no stencil */
+ int dblBuf4[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None};
+ WARN("Failed to get a visual with at least 8 bits of stencil\n");
+
+ wine_tsx11_lock();
+ visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf4);
+ wine_tsx11_unlock();
+ if (visual == NULL) {
+ /* This should only happen if we cannot find a match with a depth size 16 */
+ FIXME("Failed to find a suitable visual\n");
+ return visual;
+ }
}
}
}
--
1.4.4.3
More information about the wine-patches
mailing list