comparison src/video/riscos/SDL_wimppoll.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents 3692456e7b0f
children d910939febfa
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
27 Implements Pumping of events and WIMP polling 27 Implements Pumping of events and WIMP polling
28 */ 28 */
29 29
30 #include "SDL.h" 30 #include "SDL.h"
31 #include "SDL_syswm.h" 31 #include "SDL_syswm.h"
32 #include "SDL_sysevents.h" 32 #include "../../events/SDL_sysevents.h"
33 #include "SDL_events_c.h" 33 #include "../../events/SDL_events_c.h"
34 #include "SDL_riscosvideo.h" 34 #include "SDL_riscosvideo.h"
35 #include "SDL_riscosevents_c.h" 35 #include "SDL_riscosevents_c.h"
36 #include "SDL_riscosmouse_c.h" 36 #include "SDL_riscosmouse_c.h"
37 #include "SDL_timer_c.h" 37 #include "SDL_timer_c.h"
38 38
42 42
43 #include "kernel.h" 43 #include "kernel.h"
44 #include "swis.h" 44 #include "swis.h"
45 #include "unixlib/os.h" 45 #include "unixlib/os.h"
46 46
47 #ifndef DISABLE_THREADS 47 #if !SDL_THREADS_DISABLED
48 #include <pthread.h> 48 #include <pthread.h>
49 #endif 49 #endif
50 50
51 /* Local functions */ 51 /* Local functions */
52 void WIMP_Poll(_THIS, int waitTime); 52 void WIMP_Poll(_THIS, int waitTime);
59 59
60 60
61 extern void WIMP_PollMouse(_THIS); 61 extern void WIMP_PollMouse(_THIS);
62 extern void RISCOS_PollKeyboard(); 62 extern void RISCOS_PollKeyboard();
63 63
64 #ifdef DISABLE_THREADS 64 #if SDL_THREADS_DISABLED
65 /* Timer running function */ 65 /* Timer running function */
66 extern void RISCOS_CheckTimer(); 66 extern void RISCOS_CheckTimer();
67
68 #else 67 #else
69 extern int riscos_using_threads; 68 extern int riscos_using_threads;
70 #endif 69 #endif
71 70
72 /* Mouse cursor handling */ 71 /* Mouse cursor handling */
82 void WIMP_PumpEvents(_THIS) 81 void WIMP_PumpEvents(_THIS)
83 { 82 {
84 WIMP_Poll(this, 0); 83 WIMP_Poll(this, 0);
85 if (hasFocus) RISCOS_PollKeyboard(); 84 if (hasFocus) RISCOS_PollKeyboard();
86 if (mouseInWindow) WIMP_PollMouse(this); 85 if (mouseInWindow) WIMP_PollMouse(this);
87 #ifdef DISABLE_THREADS 86 #if SDL_THREADS_DISABLED
88 if (SDL_timer_running) RISCOS_CheckTimer(); 87 if (SDL_timer_running) RISCOS_CheckTimer();
89 #endif 88 #endif
90 } 89 }
91 90
92 91
108 waitTime += regs.r[0]; 107 waitTime += regs.r[0];
109 } 108 }
110 109
111 while (doPoll) 110 while (doPoll)
112 { 111 {
113 #ifndef DISABLE_THREADS 112 #if !SDL_THREADS_DISABLED
114 /* Stop thread callbacks while program is paged out */ 113 /* Stop thread callbacks while program is paged out */
115 if (riscos_using_threads) __pthread_stop_ticker(); 114 if (riscos_using_threads) __pthread_stop_ticker();
116 #endif 115 #endif
117 116
118 if (waitTime <= 0) 117 if (waitTime <= 0)
287 SDL_memcpy(wmmsg.pollBlock, message, 64 * sizeof(int)); 286 SDL_memcpy(wmmsg.pollBlock, message, 64 * sizeof(int));
288 287
289 /* Fall out of polling loop if message is successfully posted */ 288 /* Fall out of polling loop if message is successfully posted */
290 if (SDL_PrivateSysWMEvent(&wmmsg)) doPoll = 0; 289 if (SDL_PrivateSysWMEvent(&wmmsg)) doPoll = 0;
291 } 290 }
292 #ifndef DISABLE_THREADS 291 #if !SDL_THREADS_DISABLED
293 if (riscos_using_threads) 292 if (riscos_using_threads)
294 { 293 {
295 /* Restart ticker here so other thread can not interfere 294 /* Restart ticker here so other thread can not interfere
296 with the Redraw processing */ 295 with the Redraw processing */
297 if (riscos_using_threads) __pthread_start_ticker(); 296 if (riscos_using_threads) __pthread_start_ticker();
322 { 321 {
323 if (current_video && current_video->hidden->window_handle) 322 if (current_video && current_video->hidden->window_handle)
324 { 323 {
325 WIMP_Poll(current_video, 0); 324 WIMP_Poll(current_video, 0);
326 } 325 }
327 #ifdef DISABLE_THREADS 326 #if SDL_THREADS_DISABLED
328 if (SDL_timer_running) RISCOS_CheckTimer(); 327 if (SDL_timer_running) RISCOS_CheckTimer();
329 #endif 328 #endif
330 } 329 }