Page MenuHomePhabricator (Chris)

main.cpp
No OneTemporary

Authored By
Unknown
Size
585 B
Referenced Files
None
Subscribers
None

main.cpp

//#include <iostream>
#include "SDL.h"
#include "Game.h"
int main(int argc, char *argv[]) {
int FPS = 60, frameDelay = 1000 / FPS;
Uint32 frameStart;
int frameTime;
Game game(false, 1.5);
while (game.running()) {
if (game.gameData.FPS != FPS) {
FPS = game.gameData.FPS;
frameDelay = 1000 / FPS;
}
frameStart = SDL_GetTicks();
game.update();
frameTime = SDL_GetTicks() - frameStart;
if (frameDelay > frameTime) {
SDL_Delay(frameDelay - frameTime);
}
}
return 0;
}

File Metadata

Mime Type
text/x-c
Expires
Sun, Nov 15, 3:09 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
138512
Default Alt Text
main.cpp (585 B)

Event Timeline