1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef TINYSHOOTER_RENDERER_H
- #define TINYSHOOTER_RENDERER_H
- #include "../constantes.h"
- #include <SDL.h>
- #include <vector>
- #include <map>
- #include <SDL_ttf.h>
- class Renderer {
- public :
- Renderer();
- virtual ~Renderer();
- bool initialize();
- void clearWindow();
- void renderName(SDL_Rect &dst, std::string name);
- void renderBoolMatrix(bool mat[WIN_H][WIN_W]);
- void presentWindow();
- SDL_Window *getWindow() const;
- private:
- bool loadStringTexture(std::string name);
- protected:
- int m_screenWidth;
- int m_screenHeight;
- SDL_Window *m_window;
- SDL_Renderer *m_renderer;
- TTF_Font *m_font;
- std::vector<SDL_Texture *> m_pictureTab;
- std::map<std::string, SDL_Texture *> m_stringTab;
- };
- #endif
|