leocad/common/lc_stringcache.h

28 lines
550 B
C
Raw Normal View History

2018-09-24 04:31:33 +02:00
#pragma once
struct lcStringCacheEntry
{
int Left, Right, Top, Bottom;
};
class lcStringCache
{
public:
2020-03-23 00:19:15 +01:00
lcStringCache();
2018-09-24 04:31:33 +02:00
~lcStringCache();
2020-07-11 18:17:43 +02:00
void Initialize(lcContext* Context);
void Reset();
2018-09-24 04:31:33 +02:00
void CacheStrings(const QStringList& Strings);
2018-09-24 04:31:33 +02:00
void GetStringDimensions(int* cx, int* cy, const QString& String) const;
void DrawStrings(lcContext* Context, const lcMatrix44* Transforms, const QStringList& Strings) const;
protected:
lcTexture* mTexture;
std::map<QString, lcStringCacheEntry> mStrings;
};
extern lcStringCache gStringCache;