game/sdlpp/sdlpp_fontconfiguration.hpp
zv0n 73f67a3f47 SDLPP: Use FontConfiguration to store font configuration
With this it is possible to only store 1 configuration object
as opposed to storing font configuration inside every TextRenderer
2021-01-30 21:32:08 +01:00

52 lines
1.1 KiB
C++

#ifndef SDLPP_HPP_FONT_CONFIGURATION
#define SDLPP_HPP_FONT_CONFIGURATION
#include "sdlpp_common.hpp"
#include "sdlpp_font.hpp"
namespace SDLPP {
class SDLPPSCOPE FontConfiguration {
public:
FontConfiguration() = delete;
FontConfiguration( std::shared_ptr< Font > font, const std::string &color,
const std::string &outline_color, double outline_size ) {
_font = font;
_color = color;
_outline_color = outline_color;
_outline_size = outline_size;
}
const std::shared_ptr< Font > &getFont() {
return _font;
}
const std::string &getColor() {
return _color;
}
const std::string &getOutlineColor() {
return _outline_color;
}
const double &getOutlineSize() {
return _outline_size;
}
void setColor( const std::string &color ) {
_color = color;
}
void setOutlineColor( const std::string &outline_color ) {
_outline_color = outline_color;
}
private:
std::shared_ptr< Font > _font;
std::string _color;
std::string _outline_color;
double _outline_size;
};
} // namespace SDLPP
#endif