[3/7] WineD3D: Store the number of aux buffers in the gl limits structure

Stefan Dösinger stefan at codeweavers.com
Tue Mar 6 07:59:16 CST 2007


-------------- next part --------------
From 608a10d8cf74b2f5d9de584712e2a5415d2eba2d Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Sun, 4 Mar 2007 23:29:28 +0100
Subject: [PATCH] WineD3D: Store the number of aux buffers in the gl limits structure

---
 dlls/wined3d/device.c     |    5 +----
 dlls/wined3d/directx.c    |    4 ++++
 include/wine/wined3d_gl.h |    1 +
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index af28e96..6a78b23 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1730,10 +1730,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
 
         case ORM_BACKBUFFER:
         {
-            GLint auxBuffers;
-            glGetIntegerv(GL_AUX_BUFFERS, &auxBuffers);
-            TRACE("Got %d aux buffers\n", auxBuffers);
-            if(auxBuffers > 0) {
+            if(GL_LIMITS(aux_buffers) > 0) {
                 TRACE("Using auxilliary buffer for offscreen rendering\n");
                 This->offscreenBuffer = GL_AUX0;
             } else {
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d3ce06f..c464fbe 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -546,6 +546,10 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
     gl_info->max_pointsize = gl_floatv[1];
     TRACE_(d3d_caps)("Maximum point size support - max point size=%f\n", gl_floatv[1]);
 
+    glGetIntegerv(GL_AUX_BUFFERS, &gl_max);
+    gl_info->max_aux_buffers = gl_max;
+    TRACE_(d3d_caps)("Offscreen rendering support - number of aux buffers=%d\n", gl_max);
+
     /* Parse the gl supported features, in theory enabling parts of our code appropriately */
     GL_Extensions = (const char *) glGetString(GL_EXTENSIONS);
     TRACE_(d3d_caps)("GL_Extensions reported:\n");
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index 7af8c98..4f85461 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -1875,6 +1875,7 @@ typedef struct _WineD3D_GL_Info {
   float  max_pointsize;
   UINT   max_blends;
   UINT   max_anisotropy;
+  UINT   max_aux_buffers;
 
   unsigned max_vshader_constantsF;
   unsigned max_pshader_constantsF;
-- 
1.4.4.3



More information about the wine-patches mailing list