コード例 #1
0
ファイル: glut_event.c プロジェクト: LosingLin/regal
void
handleTimeouts(void)
{
#ifdef OLD_VMS
   struct timeval6 now;
#else
   struct timeval now;
#endif
   GLUTtimer *timer;

  /* Assumption is that __glutTimerList is already determined
     to be non-NULL. */
  GETTIMEOFDAY(&now);
  while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
    timer = __glutTimerList;
    /* call the timer function */
    timer->func(timer->value);
    /* remove from the linked list */
    __glutTimerList = timer->next;
    /* put this timer on the "free" list */
    timer->next = freeTimerList;
    freeTimerList = timer;

    if (!__glutTimerList)
      break;
  }
}
コード例 #2
0
ファイル: glut_event.c プロジェクト: AlexGreulich/HRTFVR
void
handleTimeouts(void)
{
  struct timeval now;
  GLUTtimer *timer;

  /* Assumption is that __glutTimerList is already determined
     to be non-NULL. */
  GETTIMEOFDAY(&now);
  while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
    timer = __glutTimerList;
    timer->func(timer->value);
    __glutTimerList = timer->next;
    timer->next = freeTimerList;
    freeTimerList = timer;
    if (!__glutTimerList)
      break;
  }
}
コード例 #3
0
ファイル: glutEvent.cpp プロジェクト: aljen/haiku-opengl
/***********************************************************
 *	FUNCTION:	handleTimeouts
 *
 *	DESCRIPTION:  private function to handle outstanding timeouts
 ***********************************************************/
static void
handleTimeouts(void)
{
  bigtime_t now;
  GLUTtimer *timer;

  /* Assumption is that __glutTimerList is already determined
     to be non-NULL. */
  now = system_time();
  while (__glutTimerList->timeout <= now) {
    timer = __glutTimerList;
    if(gState.currentWindow)
	    gState.currentWindow->LockGL();
    timer->func(timer->value);
    if(gState.currentWindow)
	    gState.currentWindow->UnlockGL();
    __glutTimerList = timer->next;
    timer->next = freeTimerList;
    freeTimerList = timer;
    if (!__glutTimerList)
      break;
  }
}