Roderick Colenbrander : wgl: Add WGL_SWAP_METHOD_ARB support.

Alexandre Julliard julliard at winehq.org
Mon May 18 08:13:14 CDT 2009


Module: wine
Branch: master
Commit: cc96ce438a8ec7eb62b6d2c2fc455485b73108f0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cc96ce438a8ec7eb62b6d2c2fc455485b73108f0

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Sat May 16 00:00:24 2009 +0200

wgl: Add WGL_SWAP_METHOD_ARB support.

---

 dlls/winex11.drv/opengl.c |   14 ++++++++++++++
 include/wine/wgl.h        |    4 ++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index ed46d69..774e4ca 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -730,6 +730,12 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
       TRACE("pAttr[%d] = WGL_SUPPORT_OPENGL_ARB: %d\n", cur, pop);
       break;
 
+    case WGL_SWAP_METHOD_ARB:
+      pop = iWGLAttr[++cur];
+      /* For now we ignore this and just return SWAP_EXCHANGE */
+      TRACE("pAttr[%d] = WGL_SWAP_METHOD_ARB: %#x\n", cur, pop);
+      break;
+
     case WGL_PBUFFER_LARGEST_ARB:
       pop = iWGLAttr[++cur];
       PUSH2(oGLXAttr, GLX_LARGEST_PBUFFER, pop);
@@ -2901,6 +2907,14 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelF
                     piValues[i] = GL_FALSE;
                 continue;
 
+            case WGL_SWAP_METHOD_ARB:
+                /* For now return SWAP_EXCHANGE_ARB which is the best type of buffer switch available.
+                 * Later on we can also use GLX_OML_swap_method on drivers which support this. At this
+                 * point only ATI offers this.
+                 */
+                piValues[i] = WGL_SWAP_EXCHANGE_ARB;
+                break;
+
             case WGL_PBUFFER_LARGEST_ARB:
                 curGLXAttr = GLX_LARGEST_PBUFFER;
                 break;
diff --git a/include/wine/wgl.h b/include/wine/wgl.h
index 29ab536..a102109 100644
--- a/include/wine/wgl.h
+++ b/include/wine/wgl.h
@@ -79,6 +79,10 @@
 #define WGL_GENERIC_ACCELERATION_ARB		0x2026
 #define WGL_FULL_ACCELERATION_ARB		0x2027
 
+#define WGL_SWAP_EXCHANGE_ARB		0x2028
+#define WGL_SWAP_COPY_ARB			0x2029
+#define WGL_SWAP_UNDEFINED_ARB		0x202A
+
 #define WGL_PBUFFER_WIDTH_ARB                   0x2034
 #define WGL_PBUFFER_HEIGHT_ARB                  0x2035
 #define WGL_PBUFFER_LOST_ARB                    0x2036




More information about the wine-cvs mailing list