Rev 59 | Rev 75 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 59 | Rev 60 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | HDC hdc; |
26 | HDC hdc; |
27 | RECT rect; |
27 | RECT rect; |
28 | PAINTSTRUCT ps; |
28 | PAINTSTRUCT ps; |
29 | HBITMAP hbmTmp; |
29 | HBITMAP hbmTmp; |
30 | HDC hdcMem; |
30 | HDC hdcMem; |
- | 31 | INPUT mousemove_input; |
|
31 | float previous_time; |
32 | float previous_time; |
- | 33 | float screensaverwatchdog_feedtime; |
|
32 | int frame_count; |
34 | int frame_count; |
33 | int array_index; |
35 | int array_index; |
34 | char *endptr; |
36 | char *endptr; |
35 | wchar_t app_pathname[MAX_PATH]; |
37 | wchar_t app_pathname[MAX_PATH]; |
36 | wchar_t font_pathname[MAX_PATH]; |
38 | wchar_t font_pathname[MAX_PATH]; |
Line 198... | Line 200... | ||
198 | hFontChat = CreateFont (17, 0, 0, 0, FW_DONTCARE, false, false, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS, |
200 | hFontChat = CreateFont (17, 0, 0, 0, FW_DONTCARE, false, false, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS, |
199 | CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, L"Comic Sans MS"); |
201 | CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, L"Comic Sans MS"); |
200 | 202 | ||
201 | // before any rendering is done, it's a good idea to know what time it is |
203 | // before any rendering is done, it's a good idea to know what time it is |
202 | current_time = ProcessTime (); |
204 | current_time = ProcessTime (); |
- | 205 | screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog every 50 seconds |
|
203 | 206 | ||
204 | // initialize renderer |
207 | // initialize renderer |
205 | if (!Render_Init ()) |
208 | if (!Render_Init ()) |
206 | return (-1); // bomb out on error |
209 | return (-1); // bomb out on error |
207 | 210 | ||
Line 263... | Line 266... | ||
263 | // enter the main loop |
266 | // enter the main loop |
264 | while (!terminate_everything) |
267 | while (!terminate_everything) |
265 | { |
268 | { |
266 | // see what time it is |
269 | // see what time it is |
267 | current_time = ProcessTime (); |
270 | current_time = ProcessTime (); |
- | 271 | ||
- | 272 | // is it time to feed the screensaver watchdog ? (to prevent it from starting) |
|
- | 273 | if (screensaverwatchdog_feedtime < current_time) |
|
- | 274 | { |
|
- | 275 | mousemove_input.type = INPUT_MOUSE; |
|
- | 276 | memset (&mousemove_input.mi, 0, sizeof (mousemove_input.mi)); // blank out struct = no move at all :) |
|
- | 277 | mousemove_input.mi.dwFlags = MOUSEEVENTF_MOVE; |
|
- | 278 | SendInput (1, &mousemove_input, sizeof (mousemove_input)); // send a fake mouse move input event |
|
- | 279 | ||
- | 280 | screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog again in 50 seconds |
|
- | 281 | } |
|
268 | 282 | ||
269 | // are we in demo mode and is it time to quit ? |
283 | // are we in demo mode and is it time to quit ? |
270 | if (!is_registered && (current_time > DEMO_TIMEOUT)) |
284 | if (!is_registered && (current_time > DEMO_TIMEOUT)) |
271 | DestroyWindow (hMainWnd); // if so, send a quit message in order to break the loop |
285 | DestroyWindow (hMainWnd); // if so, send a quit message in order to break the loop |
272 | 286 |