hibiscus/renderer/rsdl/resources/font.hpp

28 lines
469 B
C++
Raw Normal View History

2023-05-26 21:41:51 +00:00
#pragma once
#include <string>
#include <resources/resource.hpp>
#include <SDL2/SDL_ttf.h>
namespace hibis::rsdl {
class Font : public Resource {
public:
Font(std::string path, uint size);
2023-05-26 21:41:51 +00:00
~Font();
2023-05-26 21:41:51 +00:00
uint getFontSize() { return mSize; }
2023-05-26 21:41:51 +00:00
void setFontSize(uint newSize) { mSize = newSize; loadFont(true); }
2023-05-26 21:41:51 +00:00
TTF_Font* mLoadedFont = NULL;
private:
void loadFont(bool reload = false);
uint mSize;
std::string mPath;
2023-05-26 21:41:51 +00:00
bool mDidReload = false;
};
2023-05-26 21:41:51 +00:00
}