mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
GDI: xmb draws for a few seconds and then freezes
This commit is contained in:
parent
90ef57948c
commit
8eba18a54f
@ -521,6 +521,20 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hwnd, &ps);
|
||||
|
||||
// All painting occurs here, between BeginPaint and EndPaint.
|
||||
|
||||
FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));
|
||||
|
||||
EndPaint(hwnd, &ps);
|
||||
break;
|
||||
}
|
||||
case WM_ERASEBKGND:
|
||||
break;
|
||||
case WM_DROPFILES:
|
||||
case WM_SYSCOMMAND:
|
||||
case WM_CHAR:
|
||||
|
@ -220,6 +220,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
||||
unsigned height = 0;
|
||||
bool draw = true;
|
||||
gdi_t *gdi = (gdi_t*)data;
|
||||
HWND hwnd = win32_get_window();
|
||||
|
||||
if (!frame || !frame_width || !frame_height)
|
||||
return true;
|
||||
@ -256,12 +257,14 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
||||
|
||||
if (draw)
|
||||
{
|
||||
unsigned win_width, win_height;
|
||||
HWND hwnd = win32_get_window();
|
||||
HDC dc = GetDC(hwnd);
|
||||
HDC winDC = GetDC(hwnd);
|
||||
HDC dc = CreateCompatibleDC(winDC);
|
||||
HBITMAP bmp = CreateCompatibleBitmap(winDC, width, height);
|
||||
BITMAPINFO info;
|
||||
gfx_ctx_mode_t mode;
|
||||
|
||||
SelectObject(dc, bmp);
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
|
||||
ZeroMemory(&info, sizeof(BITMAPINFO));
|
||||
@ -310,15 +313,17 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
||||
*/
|
||||
StretchDIBits(dc, 0, 0, mode.width, mode.height, 0, 0, width, height,
|
||||
frame_to_copy, &info, DIB_RGB_COLORS, SRCCOPY);
|
||||
ReleaseDC(hwnd, dc);
|
||||
DeleteObject(bmp);
|
||||
DeleteDC(dc);
|
||||
ReleaseDC(hwnd, winDC);
|
||||
}
|
||||
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
|
||||
video_context_driver_update_window_title();
|
||||
|
||||
video_context_driver_swap_buffers();
|
||||
|
||||
//UpdateWindow(win32_get_window());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user