The Game Engine  1
main.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string>
4 #include <SDL/SDL.h>
5 #include <iostream>
6 #include <sstream>
7 #include <vector>
8 #include "fns.h"
9 #include "Game.h"
10 
11 using namespace std;
12 
13 template<class T> string to_string(const T& t)
14 {
15  ostringstream os;
16  os << t;
17  return os.str();
18 }
19 
20 //-------------------------------------------------------------------//
21 // Function : main() - Params : argc, argv
22 // Main program function
23 // This function calls the init() function then loops on draw function
24 // until an escape condition is reached
25 int main (int argc, char *argv[])
26 {
27  if(argc>1){
28  string s(argv[1]);
29  if(s == "test")
30  Game::game()->setCurrentLevel("Test");
31  }
32  Game::game()->run();
33 
34  return 0;
35 }