37 lines
954 B
C++
37 lines
954 B
C++
#ifndef SDLPP_HPP_RENDERER
|
|
#define SDLPP_HPP_RENDERER
|
|
|
|
#include "sdlpp_common.hpp"
|
|
#include "sdlpp_window.hpp"
|
|
#include "sdlpp_vector.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
namespace SDLPP {
|
|
class SDLPPSCOPE Renderer {
|
|
public:
|
|
Renderer() = delete;
|
|
Renderer( Window &window );
|
|
virtual ~Renderer();
|
|
SDL_Renderer *getRendererPtr();
|
|
Vec2D< int > getDimensions() const;
|
|
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();
|
|
Vec2D< double > getDoubleDimensions() const;
|
|
|
|
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 };
|
|
};
|
|
} // end of namespace SDLPP
|
|
#endif
|