aboutsummaryrefslogtreecommitdiff
path: root/include/graphics.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-21 13:22:38 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-21 13:22:38 +0100
commitad8ae988ba1928af5063ca1dc7375356e467979b (patch)
tree27a6738ff0172e4ebdaed7174cd7b47cc3ec9d59 /include/graphics.hpp
parent88f5eb3447073fc6a87786da6a9b6b788f9bde66 (diff)
downloadmario_sokoban-ad8ae988ba1928af5063ca1dc7375356e467979b.tar.gz
mario_sokoban-ad8ae988ba1928af5063ca1dc7375356e467979b.tar.bz2
mario_sokoban-ad8ae988ba1928af5063ca1dc7375356e467979b.zip
Sprites loading and display, player move
Diffstat (limited to 'include/graphics.hpp')
-rw-r--r--include/graphics.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/graphics.hpp b/include/graphics.hpp
index d51b47a..54f7d35 100644
--- a/include/graphics.hpp
+++ b/include/graphics.hpp
@@ -4,6 +4,7 @@
#include <iostream>
#include <string>
#include <SDL2/SDL.h>
+#include <SDL2/SDL_image.h>
#include "game.hpp"
class Graphics
@@ -23,10 +24,17 @@ private:
int m_height;
SDL_Renderer *m_renderer;
SDL_Window *m_window;
+ SDL_Texture *m_wallTex;
+ SDL_Texture *m_crateTex;
+ SDL_Texture *m_payloadTex;
+ SDL_Texture *m_playerTex;
void drawGame();
void drawCell(Game::Cell cell, int y, int x);
+ void drawPlayer();
void handleEvent();
+ SDL_Texture *loadImage(std::string filename);
+ void putImage(SDL_Texture *tex, SDL_Rect *destRect);
void error() const;
};