本文整理汇总了C++中SDL_VideoDevice::PumpEvents方法的典型用法代码示例。如果您正苦于以下问题:C++ SDL_VideoDevice::PumpEvents方法的具体用法?C++ SDL_VideoDevice::PumpEvents怎么用?C++ SDL_VideoDevice::PumpEvents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SDL_VideoDevice
的用法示例。
在下文中一共展示了SDL_VideoDevice::PumpEvents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static int SDLCALL SDL_GobbleEvents(void *unused)
{
event_thread = SDL_ThreadID();
#ifdef __OS2__
#ifdef USE_DOSSETPRIORITY
/* Increase thread priority, so it will process events in time for sure! */
DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0);
#endif
#endif
while ( SDL_EventQ.active ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
/* Get events from the video subsystem */
if ( video ) {
video->PumpEvents(this);
}
/* Queue pending key-repeat events */
SDL_CheckKeyRepeat();
#if !SDL_JOYSTICK_DISABLED
/* Check for joystick state change */
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
SDL_JoystickUpdate();
}
#endif
/* Give up the CPU for the rest of our timeslice */
SDL_EventLock.safe = 1;
if ( SDL_timer_running ) {
SDL_ThreadedTimerCheck();
}
SDL_Delay(1);
/* Check for event locking.
On the P of the lock mutex, if the lock is held, this thread
will wait until the lock is released before continuing. The
safe flag will be set, meaning that the other thread can go
about it's business. The safe flag is reset before the V,
so as soon as the mutex is free, other threads can see that
it's not safe to interfere with the event thread.
*/
SDL_mutexP(SDL_EventLock.lock);
SDL_EventLock.safe = 0;
SDL_mutexV(SDL_EventLock.lock);
}
SDL_SetTimerThreaded(0);
event_thread = 0;
return(0);
}
示例2:
static int SDLCALL SDL_GobbleEvents(void *unused)
{
event_thread = SDL_ThreadID();
#ifdef __OS2__
#ifdef USE_DOSSETPRIORITY
DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0);
#endif
#endif
while ( SDL_EventQ.active ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
if ( video ) {
video->PumpEvents(this);
}
SDL_CheckKeyRepeat();
#if !SDL_JOYSTICK_DISABLED
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
SDL_JoystickUpdate();
}
#endif
SDL_EventLock.safe = 1;
if ( SDL_timer_running ) {
SDL_ThreadedTimerCheck();
}
SDL_Delay(1);
SDL_mutexP(SDL_EventLock.lock);
SDL_EventLock.safe = 0;
SDL_mutexV(SDL_EventLock.lock);
}
SDL_SetTimerThreaded(0);
event_thread = 0;
return(0);
}
示例3: SDL_PumpEvents
void SDL_PumpEvents(void)
{
if ( !SDL_EventThread ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
if ( video ) {
video->PumpEvents(this);
}
SDL_CheckKeyRepeat();
#if !SDL_JOYSTICK_DISABLED
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
SDL_JoystickUpdate();
}
#endif
}
}
示例4: SDL_PumpEvents
/* Run the system dependent event loops */
void SDL_PumpEvents(void)
{
if ( !SDL_EventThread ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
/* Get events from the video subsystem */
if ( video ) {
video->PumpEvents(this);
}
/* Queue pending key-repeat events */
SDL_CheckKeyRepeat();
#if !SDL_JOYSTICK_DISABLED
/* Check for joystick state change */
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
SDL_JoystickUpdate();
}
#endif
}
}