Ejemplo n.º 1
0
static void fghcbProcessWork( SFG_Window *window,
                              SFG_Enumerator *enumerator )
{
    if( window->State.WorkMask )
		fgProcessWork ( window );

    fgEnumSubWindows( window, fghcbProcessWork, enumerator );
}
Ejemplo n.º 2
0
static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
{
    if( w->State.Redisplay )
    {
        e->found = GL_TRUE;
        e->data = w;
    }
    fgEnumSubWindows( w, fghHavePendingRedisplaysCallback, e );
}
Ejemplo n.º 3
0
/*
 * Indicates whether Joystick events are being used by ANY window.
 *
 * The current mechanism is to walk all of the windows and ask if
 * there is a joystick callback.  We have a short-circuit early
 * return if we find any joystick handler registered.
 *
 * The real way to do this is to make use of the glutTimer() API
 * to more cleanly re-implement the joystick API.  Then, this code
 * and all other "joystick timer" code can be yanked.
 *
 */
static void fghCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e)
{
    if( FETCH_WCB( *w, Joystick ) )
    {
        e->found = GL_TRUE;
        e->data = w;
    }
    fgEnumSubWindows( w, fghCheckJoystickCallback, e );
}
Ejemplo n.º 4
0
/*
 * Indicates whether work is pending for ANY window.
 *
 * The current mechanism is to walk all of the windows and ask if
 * work is pending. We have a short-circuit early return if we find any.
 */
static void fghHavePendingWorkCallback( SFG_Window* w, SFG_Enumerator* e)
{
    if( w->State.WorkMask )
    {
        e->found = GL_TRUE;
        e->data = w;
        return;
    }
    fgEnumSubWindows( w, fghHavePendingWorkCallback, e );
}
Ejemplo n.º 5
0
/*
 * A static helper function to look for a window given its ID
 */
static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
{
    /* Make sure we do not overwrite our precious results... */
    if( enumerator->found )
        return;

    /* Check the window's handle. Hope this works. Looks ugly. That's for sure. */
    if( window->ID == *( int *)(enumerator->data) )
    {
        enumerator->found = GL_TRUE;
        enumerator->data = window;

        return;
    }

    /* Otherwise, check this window's children */
    fgEnumSubWindows( window, fghcbWindowByID, enumerator );
}
Ejemplo n.º 6
0
/*
 * A static helper function to look for a window given its handle
 */
static void fghcbWindowByHandle( SFG_Window *window,
                                 SFG_Enumerator *enumerator )
{
    if ( enumerator->found )
        return;

    /* Check the window's handle. Hope this works. Looks ugly. That's for sure. */
    if( window->Window.Handle == (SFG_WindowHandleType) (enumerator->data) )
    {
        enumerator->found = GL_TRUE;
        enumerator->data = window;

        return;
    }

    /* Otherwise, check this window's children */
    fgEnumSubWindows( window, fghcbWindowByHandle, enumerator );
}
Ejemplo n.º 7
0
/*
 * Window enumerator callback to check for the joystick polling code
 */
static void fghcbCheckJoystickPolls( SFG_Window *window,
                                     SFG_Enumerator *enumerator )
{
    fg_time_t checkTime;
    
    if (window->State.JoystickPollRate > 0 && FETCH_WCB( *window, Joystick ))
    {
        /* This window has a joystick to be polled (if pollrate <= 0, user needs to poll manually with glutForceJoystickFunc */
        checkTime= fgElapsedTime( );

        if( window->State.JoystickLastPoll + window->State.JoystickPollRate <=
            checkTime )
        {
#if !defined(_WIN32_WCE)
            fgJoystickPollWindow( window );
#endif /* !defined(_WIN32_WCE) */
            window->State.JoystickLastPoll = checkTime;
        }
    }

    fgEnumSubWindows( window, fghcbCheckJoystickPolls, enumerator );
}
Ejemplo n.º 8
0
/* Check all windows for dialbox callbacks */
static void fghcbEnumDialCallbacks ( SFG_Window *window, SFG_Enumerator *enumerator )
{
    /* Built-in to INVOKE_WCB():  if window->Callbacks[CB_Dials] */
    INVOKE_WCB ( *window,Dials, ( ((int*)enumerator->data)[0], ((int*)enumerator->data)[1]) );
    fgEnumSubWindows ( window, fghcbEnumDialCallbacks, enumerator );
}