31 lines
492 B
C++
31 lines
492 B
C++
|
#pragma once
|
||
|
|
||
|
#include <string>
|
||
|
#include <resources/resource.hpp>
|
||
|
|
||
|
#include <SDL2/SDL_ttf.h>
|
||
|
|
||
|
namespace hibis {
|
||
|
namespace rsdl {
|
||
|
class Font : public Resource {
|
||
|
public:
|
||
|
Font(std::string path, uint size);
|
||
|
|
||
|
~Font();
|
||
|
|
||
|
uint getFontSize() { return size; }
|
||
|
|
||
|
void setFontSize(uint newSize) { size = newSize; loadFont(true); }
|
||
|
|
||
|
|
||
|
TTF_Font* loadedFont = NULL;
|
||
|
private:
|
||
|
void loadFont(bool reload = false);
|
||
|
uint size;
|
||
|
std::string path;
|
||
|
|
||
|
bool didReload = false;
|
||
|
};
|
||
|
}
|
||
|
}
|