From 166c06083212a5657fcaf03328bf530f9eb8b0d8 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 21 Mar 2020 02:19:32 +0100 Subject: Initial commit --- include/graphics.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/graphics.hpp (limited to 'include/graphics.hpp') diff --git a/include/graphics.hpp b/include/graphics.hpp new file mode 100644 index 0000000..ef0c813 --- /dev/null +++ b/include/graphics.hpp @@ -0,0 +1,32 @@ +#ifndef GRAPHICS_HPP +# define GRAPHICS_HPP + +#include +#include +#include +#include "game.hpp" + +class Graphics +{ + public: + Graphics(Game &game, std::string title, int width, int height); + ~Graphics(); + + void update(); + bool isRunning() const; + + private: + bool m_running; + Game &m_game; + std::string m_title; + int m_width; + int m_height; + SDL_Renderer *m_renderer; + SDL_Window *m_window; + + void drawGame(); + void handleEvent(); + void error() const; +}; + +#endif -- cgit