Create win32_check_window

This commit is contained in:
twinaphex 2015-04-10 09:36:03 +02:00
parent b46c9cea87
commit a3e14acaa3
4 changed files with 17 additions and 15 deletions

View File

@ -226,3 +226,16 @@ void win32_show_cursor(bool state)
while (ShowCursor(FALSE) >= 0);
#endif
}
void win32_check_window(void)
{
#ifndef _XBOX
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
#endif
}

View File

@ -42,6 +42,8 @@ bool win32_get_metrics(void *data,
void win32_show_cursor(bool state);
void win32_check_window(void);
#ifdef __cplusplus
}
#endif

View File

@ -286,15 +286,8 @@ static void gfx_ctx_d3d_check_window(void *data, bool *quit,
*quit = true;
if (d3d->should_resize)
*resize = true;
#ifndef _XBOX
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
#endif
win32_check_window();
}
#ifdef _XBOX

View File

@ -313,17 +313,11 @@ static void gfx_ctx_wgl_swap_interval(void *data, unsigned interval)
static void gfx_ctx_wgl_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
MSG msg;
win32_check_window();
(void)data;
(void)frame_count;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
*quit = g_quit;
if (g_resized)