当前位置: 首页>>代码示例>>C++>>正文


C++ SDL_VideoDevice::PumpEvents方法代码示例

本文整理汇总了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);
}
开发者ID:ahpho,项目名称:wowmapviewer,代码行数:53,代码来源:SDL_events.c

示例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);
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:45,代码来源:SDL_events.c

示例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
	}
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:22,代码来源:SDL_events.c

示例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
	}
}
开发者ID:ahpho,项目名称:wowmapviewer,代码行数:23,代码来源:SDL_events.c


注:本文中的SDL_VideoDevice::PumpEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。