From b6f7dca618b502a76422b634ff38288f4e8c53e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Wed, 18 Jun 2014 17:24:18 +0000 Subject: [PATCH] [OPENGL32] - Fix bitfields for 16-bits pixel format svn path=/trunk/; revision=63614 --- reactos/dll/opengl/opengl32/swimpl.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/reactos/dll/opengl/opengl32/swimpl.c b/reactos/dll/opengl/opengl32/swimpl.c index 3fb164f85dd..a0e75c24bf9 100644 --- a/reactos/dll/opengl/opengl32/swimpl.c +++ b/reactos/dll/opengl/opengl32/swimpl.c @@ -51,7 +51,7 @@ static const struct { MESA_FORMAT_RGB888, 24, 8, 0, 0x00000000, 8, 8, 0x00000000, 8, 16, 0x00000000, 0, 0, 0x00000000, 16, 16, 8, BI_RGB }, // { MESA_FORMAT_BGR888, 24, 8, 16, 8, 8, 8, 0, 0, 0, 16, 32, 8 }, // { MESA_FORMAT_BGR888, 24, 8, 16, 8, 8, 8, 0, 0, 0, 16, 16, 8 }, - { MESA_FORMAT_RGB565, 16, 5, 0, 0x00000000, 6, 5, 0x00000000, 5, 11, 0x00000000, 0, 0, 0x00000000, 16, 32, 8, BI_BITFIELDS }, + { MESA_FORMAT_RGB565, 16, 5, 0, 0x0000F800, 6, 5, 0x000007E0, 5, 11, 0x0000001F, 0, 0, 0x00000000, 16, 32, 8, BI_BITFIELDS }, { MESA_FORMAT_RGB565, 16, 5, 0, 0x0000F800, 6, 5, 0x000007E0, 5, 11, 0x0000001F, 0, 0, 0x00000000, 16, 16, 8, BI_BITFIELDS }, }; @@ -361,15 +361,15 @@ INT sw_DescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR INT nb_win_compat = 0, start_win_compat = 0; INT ret = sizeof(pixel_formats)/sizeof(pixel_formats[0]); - if(GetObjectType(hdc) == OBJ_DC) + if (GetObjectType(hdc) == OBJ_DC) { /* Find the window compatible formats */ INT bpp = GetDeviceCaps(hdc, BITSPIXEL); - for(index = 0; indexformat_index = index_from_format(dc_data, format, &doubleBuffered); + TRACE("Using format %u - double buffered: %x.\n", fb->format_index, doubleBuffered); fb->flags = doubleBuffered ? SW_FB_DOUBLEBUFFERED : 0; /* Set the bitmap info describing the framebuffer */ fb->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -663,6 +667,9 @@ sw_call_window_proc( * of the client area via GetClientRect. */ RECT client_rect; UINT width, height; + + TRACE("Got WM_WINDOWPOSCHANGED\n"); + GetClientRect(pParams->hwnd, &client_rect); width = client_rect.right - client_rect.left; height = client_rect.bottom - client_rect.top; -- 2.17.1