summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..41d1b05
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,33 @@
+#include "graphics.h"
+#include "game.h"
+#include "config.h"
+
+void update(float ms){
+
+ Game * game = reinterpret_cast<Game *>(graphics::getUserData());
+ game -> update();
+
+}
+
+void draw(){
+
+ Game * game = reinterpret_cast<Game *>(graphics::getUserData());
+ game -> draw();
+
+}
+
+int main()
+{
+ graphics::createWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Star Wars Episode 0: Return of the Developer");
+ graphics::setCanvasSize(WINDOW_WIDTH, WINDOW_HEIGHT);
+ graphics::setCanvasScaleMode(graphics::CANVAS_SCALE_FIT);
+ graphics::setDrawFunction(draw);
+ graphics::setUpdateFunction(update);
+
+ Game game;
+ graphics::setUserData(&game);
+
+ graphics::startMessageLoop();
+
+ return 0;
+}