Daniel Lehman : opengl32: Don' t fail with both PFD_DOUBLEBUFFER_DONTCARE and PFD_STEREO_DONTCARE.

Alexandre Julliard julliard at winehq.org
Fri Jun 23 13:08:00 CDT 2017


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

Author: Daniel Lehman <dlehman at esri.com>
Date:   Wed Jun 21 16:00:22 2017 -0700

opengl32: Don't fail with both PFD_DOUBLEBUFFER_DONTCARE and PFD_STEREO_DONTCARE.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/opengl32/tests/opengl.c | 2 +-
 dlls/opengl32/wgl.c          | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index 3366cb2..5d3a245 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -277,7 +277,7 @@ static void test_choosepixelformat(void)
     pfd.dwFlags |= PFD_DOUBLEBUFFER_DONTCARE;
     ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE failed\n" );
     pfd.dwFlags |= PFD_STEREO_DONTCARE;
-    todo_wine ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed\n" );
+    ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed\n" );
     pfd.dwFlags &= ~PFD_DOUBLEBUFFER_DONTCARE;
     ok( test_pfd(&pfd), "PFD_STEREO_DONTCARE failed\n" );
     pfd.dwFlags &= ~PFD_STEREO_DONTCARE;
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 73be013..dafafb6 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -517,6 +517,8 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
 
             if (bestDBuffer != -1 && (format.dwFlags & PFD_DOUBLEBUFFER) != bestDBuffer) continue;
         }
+        else if (!best_format)
+            goto found;
 
         /* Stereo, see the comments above. */
         if (!(ppfd->dwFlags & PFD_STEREO_DONTCARE))
@@ -527,6 +529,8 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
 
             if (bestStereo != -1 && (format.dwFlags & PFD_STEREO) != bestStereo) continue;
         }
+        else if (!best_format)
+            goto found;
 
         /* Below we will do a number of checks to select the 'best' pixelformat.
          * We assume the precedence cColorBits > cAlphaBits > cDepthBits > cStencilBits -> cAuxBuffers.




More information about the wine-cvs mailing list