// // Created by jovian on 18/07/17. // #ifndef TINYSHOOTER_RENDERER_H #define TINYSHOOTER_RENDERER_H #include #include #include #include #include "Visual.h" #include "../Contents/PlanetDef.h" class Renderer { public : Renderer(); virtual ~Renderer(); bool initialize(); // Initialize SDL and load features (return false if error) void clearWindow(); // Clear all content void renderScene(std::vector &scope, const b2Vec2 ¢er, float zoom); // Displays a view void renderPlanetHUD(PlanetDef def); void renderName(SDL_Rect &dst, std::string name); void renderBar(int y, const int &value); void presentWindow(); // Refresh window SDL_Window *getWindow() const; private: bool loadPicture(std::string name); // Load a single picture bool loadStringTexture(std::string name); // Load a texture from a string bool loadEveryPicture(); // Load all contents needed in the game protected: int m_screenWidth; int m_screenHeight; SDL_Window *m_window; // SDL main window SDL_Renderer *m_renderer; // SDL main renderer TTF_Font *m_font; // TTF main font std::vector m_pictureTab; // Every game texture std::map m_stringTab; // Every game name texture }; #endif //TINYSHOOTER_RENDERER_H