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

This commit is contained in:
Michael Müller 2015-02-03 11:07:38 +01:00 committed by Alexandre Julliard
parent e0e909ec48
commit e618ab65ed
1 changed files with 7 additions and 1 deletions

View File

@ -251,6 +251,7 @@ static BOOL dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
HBITMAP bitmap; HBITMAP bitmap;
BITMAPOBJ *bmp; BITMAPOBJ *bmp;
dib_info dib; dib_info dib;
GLenum type;
BOOL ret = FALSE; BOOL ret = FALSE;
if (!context) 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 ); 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) if (ret)
{ {
pOSMesaPixelStore( OSMESA_ROW_LENGTH, abs( dib.stride ) * 8 / dib.bit_count ); pOSMesaPixelStore( OSMESA_ROW_LENGTH, abs( dib.stride ) * 8 / dib.bit_count );