Beispiel #1
0
void Game::GameLoop()
{
    while(gameIsRunning)
    {
        SDL_RenderCopy(renderer, background_texture, NULL, NULL);
        CheckForEvents();
        SDL_RenderPresent(renderer);
    }
}
Beispiel #2
0
void SDLEventReader::performWork()
{
    if (sdlIsOpen)
    {
        //int status = SDL_WaitEvent(NULL);
        int status = CheckForEvents();

        if (status)
        {
            pollRateTimer.stop();
            emit eventRaised();
        }
    }
}
Beispiel #3
0
void Home::MainLoop()
{
    while(homeWindowIsActive)
    {
        SDL_RenderClear(renderer);

        SDL_GetMouseState(&cursorRect.x, &cursorRect.y);

        SDL_RenderCopy(renderer, backgroundTexture, NULL, NULL);
        SDL_RenderCopy(renderer, usernameLabel, NULL, &usernameLabelRect);

        AnimateTheCharacter();
        CheckForEvents();

        SDL_RenderCopy(renderer, cursor, NULL, &cursorRect);
        SDL_RenderPresent(renderer);
        SDL_Delay(50);
    }
}