game/sdlpp/sdlpp_renderer.hpp

37 lines
954 B
C++
Raw Normal View History

2020-11-21 19:57:40 +00:00
#ifndef SDLPP_HPP_RENDERER
#define SDLPP_HPP_RENDERER
#include "sdlpp_common.hpp"
#include "sdlpp_window.hpp"
#include "sdlpp_vector.hpp"
2020-11-21 19:57:40 +00:00
#include <iostream>
namespace SDLPP {
2020-11-22 22:37:55 +00:00
class SDLPPSCOPE Renderer {
2020-11-21 19:57:40 +00:00
public:
Renderer() = delete;
Renderer( Window &window );
virtual ~Renderer();
SDL_Renderer *getRendererPtr();
2021-03-15 13:50:40 +00:00
Vec2D< int > getDimensions() const;
2020-11-21 19:57:40 +00:00
int getWidth() const;
int getHeight() const;
int getSmallerSide() const;
int getLargerSide() const;
void setBlendMode( SDL_BlendMode blendMode );
void setRenderColiders( bool render );
bool getRenderColiders();
void clearRenderer();
void presentRenderer();
2021-04-26 19:57:31 +00:00
Vec2D< double > getDoubleDimensions() const;
2020-11-21 19:57:40 +00:00
private:
SDL_Renderer *renderer = NULL;
bool render_coliders = false;
mutable Vec2D< int > dimensions_cache = { 0, 0 };
mutable Vec2D< double > double_dimensions_cache = { 0.0, 0.0 };
2020-11-21 19:57:40 +00:00
};
} // end of namespace SDLPP
#endif