#include <GL/glu.h>
#include <SDL/SDL.h>
-#include <iostream>
-using std::cerr;
-using std::cout;
-using std::endl;
-
-#include <vector>
-using std::vector;
+#include "debug.h"
+#include "handleSignal.h"
#include "game.h"
#include "ticks.h"
-#include "graphics.h"
+
+#include "graphics/graphics.h"
+#include "input/inputManager.h"
+
/// ***** Private Method Headers *****
void init();
+void sighandler( int sig );
+
void run();
void cleanUp();
/// ***** Private Methods *****
void init()
{
+ installSignal();
+
graphicsInit();
gameInit();
- // TODO
- // add a game state
-
+#ifdef DEBUGGING
cout << "Initialization Complete" << endl;
+#endif
+}
+
+void cleanUp()
+{
+#ifdef DEBUGGING
+ cout << "Cleaning up" << endl;
+#endif
- // create starting entities
+ gameClean();
- cout << "World Created" << endl;
+ graphicsCleanUp();
}
void run()
}
}
-void cleanUp()
-{
- gameClean();
-}
-
void blockUpdate()
{
long int start = tickCountMicro();
draw_Count = 0;
last_Second = tickCountMicro();
+
+ //cout << "ups:\t" << ups << endl;
+ //cout << "fps:\t" << fps << endl;
}
}
void input()
{
+ inputUpdate();
+
gameInput();
- /*
- if(key[KEY_ESC])
+ if(wasReleased(SDLK_ESCAPE))
is_Running = false;
- */
}
void update(float time_step)