- rfb: the "show ips" feature now works on Windows host (separate thread

with a dummy message loop is required to make the Windows console timer work)
This commit is contained in:
Volker Ruppert 2012-08-28 18:59:56 +00:00
parent 24eb755c5a
commit de3792b7f0
2 changed files with 31 additions and 0 deletions

View File

@ -118,6 +118,7 @@ Detailed change log :
absolute pointing device (USB tablet) is active (rfb, sdl, win32, wx, x).
- Gui debugger now supported when using sdl gui on Windows
- wx: fixed random freezes with wxGTK and "show ips" feature enabled
- rfb: the "show ips" feature now works on Windows host
- Tools
- bxcommit: added support for converting growing to flat mode images

View File

@ -196,6 +196,10 @@ void rfbKeyPressed(Bit32u key, int press_release);
void rfbMouseMove(int x, int y, int bmask);
void DrawColorPalette();
#if BX_SHOW_IPS && defined(WIN32)
DWORD WINAPI ShowIPSthread(LPVOID);
#endif
static const rfbPixelFormat BGR233Format = {
8, 8, 1, 1, 7, 7, 3, 0, 3, 6
};
@ -310,6 +314,13 @@ void bx_rfb_gui_c::specific_init(int argc, char **argv, unsigned headerbar_y)
fprintf(stderr, "RFB client connected \r");
}
#if BX_SHOW_IPS && defined(WIN32)
if (!rfbHideIPS) {
DWORD threadID;
CreateThread(NULL, 0, ShowIPSthread, NULL, 0, &threadID);
}
#endif
new_gfx_api = 1;
dialog_caps = 0;
}
@ -1719,6 +1730,25 @@ void bx_rfb_gui_c::set_mouse_mode_absxy(bx_bool mode)
}
#if BX_SHOW_IPS
#ifdef WIN32
VOID CALLBACK IPSTimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)
{
bx_show_ips_handler();
}
DWORD WINAPI ShowIPSthread(LPVOID)
{
MSG msg;
UINT TimerId = SetTimer(NULL, 0, 1000, &IPSTimerProc);
while (keep_alive && GetMessage(&msg, NULL, 0, 0)) {
DispatchMessage(&msg);
}
KillTimer(NULL, TimerId);
return 0;
}
#endif
void bx_rfb_gui_c::show_ips(Bit32u ips_count)
{
if (!rfbIPSupdate && !rfbHideIPS) {