|
|
@ -1,4 +1,4 @@ |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* \defgroup winsimulator Simulation of the Borg API for the Win32 platform. |
|
|
|
*/ |
|
|
|
/*@{*/ |
|
|
@ -442,6 +442,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, |
|
|
|
HWND hWnd; |
|
|
|
MSG msg; |
|
|
|
HANDLE hThread; |
|
|
|
UINT_PTR uTimerId; |
|
|
|
|
|
|
|
/* regster window class (with nice black background!) */ |
|
|
|
if (simRegisterWindowClass(&wc, hInstance)) |
|
|
@ -460,10 +461,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, |
|
|
|
/* ensure that the display loop stays responsive */ |
|
|
|
SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST); |
|
|
|
|
|
|
|
/* issue a timer message every 40 ms (roughly 25 fps) */ |
|
|
|
/* issue a UI timer message every 40 ms (roughly 25 fps) */ |
|
|
|
/* NOTE: this has nothing to do with the multimedia timer */ |
|
|
|
SetTimer(hWnd, 23, 40, NULL); |
|
|
|
|
|
|
|
uTimerId = SetTimer(hWnd, 23, 40, NULL); |
|
|
|
if (uTimerId != NULL) |
|
|
|
{ |
|
|
|
/* standard Windows(R) message loop */ |
|
|
|
/* (runs as long as the window hasn't been closed) */ |
|
|
|
while (GetMessageA(&msg, NULL, 0, 0)) |
|
|
@ -472,6 +474,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, |
|
|
|
DispatchMessageA(&msg); |
|
|
|
} |
|
|
|
|
|
|
|
/* remove that UI timer */ |
|
|
|
KillTimer(hWnd, uTimerId); |
|
|
|
} |
|
|
|
|
|
|
|
/* stop the display loop */ |
|
|
|
TerminateThread(hThread, 0); |
|
|
|
} |
|
|
|