void Game::GameLoop() { while(gameIsRunning) { SDL_RenderCopy(renderer, background_texture, NULL, NULL); CheckForEvents(); SDL_RenderPresent(renderer); } }
void SDLEventReader::performWork() { if (sdlIsOpen) { //int status = SDL_WaitEvent(NULL); int status = CheckForEvents(); if (status) { pollRateTimer.stop(); emit eventRaised(); } } }
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); } }