aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-18 20:50:58 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-18 20:50:58 +0100
commit79ab0bdeedd6e7f97b4c246b4319af5eac545061 (patch)
tree841a4fafcd634285cf9a267e0e80550735a154c3 /src/main.cpp
parentb228349c5d3e93e8e58e96efeb332fdb58093f0f (diff)
download2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.tar.gz
2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.tar.bz2
2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.zip
game class, display of the game grid
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c4ef817..7fe08bf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,17 +1,21 @@
#include <iostream>
-#include <SDL2/SDL.h>
#include "graphics.hpp"
+#include "game.hpp"
#define WINDOW_TITLE "2048"
-#define WINDOW_WIDTH 640
+#define WINDOW_WIDTH 480
#define WINDOW_HEIGHT 480
+#define GAME_GRID_SIZE 4
int main()
{
- Graphics g = Graphics(WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT);
+ Game game = Game(GAME_GRID_SIZE);
+ Graphics *graphics = new Graphics(&game, WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT);
- while (g.isRunning())
- g.update();
+ while (graphics->isRunning())
+ graphics->update();
+
+ delete graphics;
return 0;
}