mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +02:00
call Q_INIT_RESOURCE statically from Font constructor
This commit is contained in:
parent
6a58d8b0a3
commit
961b5b5346
1 changed files with 11 additions and 0 deletions
|
@ -88,6 +88,9 @@ const float DEFAULT_POINT_SIZE = 12;
|
|||
|
||||
class Font {
|
||||
public:
|
||||
|
||||
Font();
|
||||
|
||||
using TexturePtr = QSharedPointer < QOpenGLTexture >;
|
||||
using VertexArrayPtr = QSharedPointer< QOpenGLVertexArrayObject >;
|
||||
using ProgramPtr = QSharedPointer < QOpenGLShaderProgram >;
|
||||
|
@ -183,6 +186,14 @@ Font* loadFont(const QString& family) {
|
|||
return LOADED_FONTS[family];
|
||||
}
|
||||
|
||||
Font::Font() {
|
||||
static bool fontResourceInitComplete = false;
|
||||
if (!fontResourceInitComplete) {
|
||||
Q_INIT_RESOURCE(font);
|
||||
fontResourceInitComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
// NERD RAGE: why doesn't QHash have a 'const T & operator[] const' member
|
||||
const Glyph & Font::getGlyph(const QChar & c) const {
|
||||
if (!_glyphs.contains(c)) {
|
||||
|
|
Loading…
Reference in a new issue