28 lines
469 B
C++
28 lines
469 B
C++
#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);
|
|
|
|
~Font();
|
|
|
|
uint getFontSize() { return mSize; }
|
|
|
|
void setFontSize(uint newSize) { mSize = newSize; loadFont(true); }
|
|
|
|
TTF_Font* mLoadedFont = NULL;
|
|
private:
|
|
void loadFont(bool reload = false);
|
|
uint mSize;
|
|
std::string mPath;
|
|
|
|
bool mDidReload = false;
|
|
};
|
|
}
|