diff options
Diffstat (limited to 'include/graphics.hpp')
| -rw-r--r-- | include/graphics.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
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 <iostream> +#include <string> +#include <SDL2/SDL.h> +#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 |
