From 166c06083212a5657fcaf03328bf530f9eb8b0d8 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 21 Mar 2020 02:19:32 +0100 Subject: Initial commit --- include/game.hpp | 11 +++++++++++ include/graphics.hpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 include/game.hpp create mode 100644 include/graphics.hpp (limited to 'include') diff --git a/include/game.hpp b/include/game.hpp new file mode 100644 index 0000000..017d21b --- /dev/null +++ b/include/game.hpp @@ -0,0 +1,11 @@ +#ifndef GAME_HPP +# define GAME_HPP + +class Game +{ +public: + Game(); + +}; + +#endif 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