From e618ab65ed5b623785c58ea5ece6e39895d43063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 3 Feb 2015 11:07:38 +0100 Subject: [PATCH] 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 28a03f49c66..a25da208f52 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 );