12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef TINYSHOOTER_RENDERER_H
- #define TINYSHOOTER_RENDERER_H
- #include <SDL2/SDL.h>
- #include <vector>
- #include "Visual.h"
- class Renderer {
- public :
- Renderer();
- virtual ~Renderer();
- bool initialize(int nbPlayers = 1);
- void clearWindow();
- void renderScene(std::vector<Visual *> &scope, const b2Vec2 ¢er, float zoom, int which = 0);
- void presentWindow();
- SDL_Window *getWindow() const;
-
- b2Vec2 computeDiago(float zoom, int which = 0);
- private:
- bool loadPicture(std::string name);
- bool loadEveryPicture();
- void locateViews(int nbPlayers);
- protected:
- int m_screenWidth;
- int m_screenHeight;
- SDL_Window *m_window;
- SDL_Renderer *m_renderer;
- std::vector<SDL_Texture *> m_pictureTab;
- const int m_border;
- SDL_Rect m_viewPort[4];
- };
- #endif
|