diff options
author | Nikolas <nikolas@boutalas.com> | 2024-10-27 12:52:55 +0200 |
---|---|---|
committer | Nikolas <nikolas@boutalas.com> | 2024-10-27 12:52:55 +0200 |
commit | 43394c8a8908442982e3a7e25975c31b3c952923 (patch) | |
tree | 2facd563e29f48fe3b0653ac5c113998940b4d5e /src/main.cpp |
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 33 |
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; +} |