GDI: video correctly fills the screen now, but resolution is poor. why is it scaled down by half?

This commit is contained in:
Brad Parker 2017-01-13 00:52:55 -05:00
parent 0ee3f39d76
commit d6300a7946

View File

@ -273,7 +273,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
{
HDC winDC = GetDC(hwnd);
HDC memDC = CreateCompatibleDC(winDC);
HBITMAP bmp = CreateCompatibleBitmap(winDC, width, height);
HBITMAP bmp = CreateCompatibleBitmap(winDC, pitch, height);
HBITMAP bmp_old;
BITMAPINFO *info = (BITMAPINFO*)calloc(1, sizeof(*info) + (3 * sizeof(RGBQUAD)));
//HBRUSH brush;
@ -308,7 +308,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
else
info->bmiHeader.biCompression = BI_RGB;
ret = StretchDIBits(memDC, 0, 0, width, height, 0, 0, width, height,
ret = StretchDIBits(memDC, 0, 0, pitch, height, 0, 0, pitch, height,
frame_to_copy, info, DIB_RGB_COLORS, SRCCOPY);
//printf("StretchDIBits: %d\n", ret);
@ -316,7 +316,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
ret = StretchBlt(winDC,
0, 0,
mode.width, mode.height,
memDC, 0, 0, width, height, SRCCOPY);
memDC, 0, 0, width, height / 2, SRCCOPY);
//printf("BitBlt: %d\n", ret);