[PATCH] winemac.drv: Also return the number of pixel formats if the caller didn't supply a PIXELFORMATDESCRIPTOR.

Charles Davis cdavis5x at gmail.com
Tue Jul 23 22:26:29 CDT 2013


This is akin to what glxdrv already does, and apparently what Windows
does. It allows the GLView sample from the OpenGL SuperBible to
correctly enumerate pixel formats with the Mac driver.
---
 dlls/winemac.drv/opengl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index 0922371..fb294d1 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -3281,7 +3281,7 @@ int macdrv_wglDescribePixelFormat(HDC hdc, int fmt, UINT size, PIXELFORMATDESCRI
 
     TRACE("hdc %p fmt %d size %u descr %p\n", hdc, fmt, size, descr);
 
-    if (fmt <= 0 || fmt > ret) return ret;
+    if (fmt <= 0 || fmt > ret || !descr) return ret;
     if (size < sizeof(*descr)) return 0;
 
     pf = &pixel_formats[fmt - 1];
-- 
1.7.5.4




More information about the wine-patches mailing list