leocad/common/lc_stringcache.h

28 lines
550 B
C
Raw Normal View History

2018-09-23 19:31:33 -07:00
#pragma once
struct lcStringCacheEntry
{
int Left, Right, Top, Bottom;
};
class lcStringCache
{
public:
2020-03-22 16:19:15 -07:00
lcStringCache();
2018-09-23 19:31:33 -07:00
~lcStringCache();
2020-07-11 09:17:43 -07:00
void Initialize(lcContext* Context);
void Reset();
2018-09-23 19:31:33 -07:00
void CacheStrings(const QStringList& Strings);
2018-09-23 19:31:33 -07: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;