win32: only hide cursor if in fullscreen

This commit is contained in:
OV2 2012-10-10 20:56:28 +02:00
parent 8bd1ef77ff
commit 13fafd80ab

View File

@ -217,6 +217,14 @@ static bool set_fullscreen(unsigned width, unsigned height)
return ChangeDisplaySettings(&devmode, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL;
}
static void show_cursor(bool show)
{
if(show)
while(ShowCursor(TRUE)<0);
else
while(ShowCursor(FALSE)>=0);
}
static bool gfx_ctx_set_video_mode(
unsigned width, unsigned height,
unsigned bits, bool fullscreen)
@ -272,13 +280,14 @@ static bool gfx_ctx_set_video_mode(
if (!fullscreen || windowed_full)
{
ShowCursor(FALSE);
ShowWindow(g_hwnd, SW_RESTORE);
UpdateWindow(g_hwnd);
SetForegroundWindow(g_hwnd);
SetFocus(g_hwnd);
}
show_cursor(!fullscreen);
// Wait until GL context is created (or failed to do so ...)
MSG msg;
while (!g_inited && !g_quit && GetMessage(&msg, g_hwnd, 0, 0))