Added patch to fix arguments for OSMesaMakeCurrent when using 16 bit formats.

This commit is contained in:
Sebastian Lackner
2015-02-03 12:24:48 +01:00
parent 70b8d10d2f
commit 1eeba48e51
5 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
From 8593f7d027c48153b038895e8bc0b8fca88fd666 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 3 Feb 2015 11:07:38 +0100
Subject: 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 );
--
2.2.2

View File

@@ -0,0 +1 @@
Fixes: Fix arguments for OSMesaMakeCurrent when using 16 bit formats