Ejemplo n.º 1
0
// Queue events to main thread
static int getNextEventAndLock()
{
    int nextEvent;
    if( !BufferedEventsMutex )
        return -1;
    SDL_mutexP(BufferedEventsMutex);
    nextEvent = BufferedEventsEnd;
    nextEvent++;
    if( nextEvent >= MAX_BUFFERED_EVENTS )
        nextEvent = 0;
    while( nextEvent == BufferedEventsStart )
    {
        SDL_mutexV(BufferedEventsMutex);
        if( SDL_ANDROID_InsideVideoThread() )
            SDL_ANDROID_PumpEvents();
        else
            SDL_Delay(100);
        SDL_mutexP(BufferedEventsMutex);
        nextEvent = BufferedEventsEnd;
        nextEvent++;
        if( nextEvent >= MAX_BUFFERED_EVENTS )
            nextEvent = 0;
    }
    return nextEvent;
}
void ANDROID_PumpEvents(_THIS)
{
	SDL_ANDROID_PumpEvents();
}