Skip to content
Permalink
507e57f869
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (23 sloc) 670 Bytes
#include "GameManager.h"
GameManager *gameManager = nullptr;
int main(int argc,const char * argv[]) {
const int FPS = 60;
const int frameDelay = 1000 / FPS;
Uint32 frameStart;
int frameTime;
gameManager = new GameManager();
gameManager->init("Cave Crawler", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, false);
while (gameManager->running()) {
frameStart = SDL_GetTicks();
gameManager->handleEvents();
gameManager->update();
gameManager->renderer();
frameTime = SDL_GetTicks() - frameStart;
if (frameDelay > frameTime)
{
SDL_Delay(frameDelay - frameTime);
}
}
gameManager->clean();
return 0;
}