=?UTF-8?Q?Michael=20M=C3=BCller=20?=: gdi32: Fix arguments for OSMesaMakeCurrent when using 16 bit formats.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 26 09:17:00 CST 2015


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

Author: Michael Müller <michael at fds-team.de>
Date:   Tue Feb  3 11:07:38 2015 +0100

gdi32: Fix arguments for OSMesaMakeCurrent when using 16 bit formats.

---

 dlls/gdi32/dibdrv/opengl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/dibdrv/opengl.c b/dlls/gdi32/dibdrv/opengl.c
index 28a03f4..a25da208 100644
--- a/dlls/gdi32/dibdrv/opengl.c
+++ b/dlls/gdi32/dibdrv/opengl.c
@@ -251,6 +251,7 @@ static BOOL dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
     HBITMAP bitmap;
     BITMAPOBJ *bmp;
     dib_info dib;
+    GLenum type;
     BOOL ret = FALSE;
 
     if (!context)
@@ -281,7 +282,12 @@ static BOOL dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
 
         TRACE( "context %p bits %p size %ux%u\n", context, bits, width, height );
 
-        ret = pOSMesaMakeCurrent( context->context, bits, GL_UNSIGNED_BYTE, width, height );
+        if (pixel_formats[context->format - 1].mesa == OSMESA_RGB_565)
+            type = GL_UNSIGNED_SHORT_5_6_5;
+        else
+            type = GL_UNSIGNED_BYTE;
+
+        ret = pOSMesaMakeCurrent( context->context, bits, type, width, height );
         if (ret)
         {
             pOSMesaPixelStore( OSMESA_ROW_LENGTH, abs( dib.stride ) * 8 / dib.bit_count );




More information about the wine-cvs mailing list