-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
40 lines (28 loc) · 834 Bytes
/
Main.cpp
File metadata and controls
40 lines (28 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include <SDL.h>
#include "Game.h"
#include "GraphicsSystem.h"
#include "GraphicsBufferManager.h"
#include <MemoryTracker.h>
// SDL Tutorials http://lazyfoo.net/SDL_tutorials/lesson02/index.php
// A Warning that sometimes pops up: deafultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
// Since system("pause") is a security concern, can it be replaced with something?
int main(int argc, char** argv)
{
// Seed rand
srand(unsigned(time(NULL)));
// Init SDL
int toReturn = initSDL();
if (toReturn != 0)
return toReturn;
// Init Game Object
Game::initInstance();
// Run Game Loop
Game::getInstance()->runGameLoop(60);
// End
Game::getInstance()->cleanUp();
delete Game::getInstance();
gMemoryTracker.reportAllocations(std::cout);
system("pause");
return 0;
}