diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-18 20:50:58 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-18 20:50:58 +0100 |
| commit | 79ab0bdeedd6e7f97b4c246b4319af5eac545061 (patch) | |
| tree | 841a4fafcd634285cf9a267e0e80550735a154c3 /include/graphics.hpp | |
| parent | b228349c5d3e93e8e58e96efeb332fdb58093f0f (diff) | |
| download | 2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.tar.gz 2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.tar.bz2 2048-79ab0bdeedd6e7f97b4c246b4319af5eac545061.zip | |
game class, display of the game grid
Diffstat (limited to 'include/graphics.hpp')
| -rw-r--r-- | include/graphics.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/graphics.hpp b/include/graphics.hpp index 69ac808..0990247 100644 --- a/include/graphics.hpp +++ b/include/graphics.hpp @@ -2,15 +2,20 @@ # define GRAPHICS_HPP #include <string> +#include <iostream> #include <SDL2/SDL.h> +#include <SDL2/SDL_ttf.h> +#include "game.hpp" class Graphics { public: - Graphics(std::string t, int w, int h); + Graphics(Game *g, std::string t, int w, int h); ~Graphics(); void update(); + void drawGame(); + void drawCell(int x, int y); bool isRunning(); private: @@ -18,10 +23,13 @@ class Graphics std::string title; int width; int height; + Game *game; SDL_Renderer *renderer; SDL_Window *window; + TTF_Font *font; void handleEvent(); + void error(); }; #endif |
