mirror of
https://github.com/leozide/leocad
synced 2025-01-03 23:03:55 +01:00
30 lines
624 B
C
30 lines
624 B
C
|
#pragma once
|
||
|
|
||
|
struct lcStringCacheEntry
|
||
|
{
|
||
|
int Left, Right, Top, Bottom;
|
||
|
};
|
||
|
|
||
|
class lcStringCache
|
||
|
{
|
||
|
public:
|
||
|
lcStringCache();
|
||
|
~lcStringCache();
|
||
|
|
||
|
void AddRef(lcContext* Context);
|
||
|
void Release(lcContext* Context);
|
||
|
|
||
|
void CacheStrings(lcContext* Context, const QStringList& Strings);
|
||
|
void GetStringDimensions(int* cx, int* cy, const QString& String) const;
|
||
|
void DrawStrings(lcContext* Context, const lcMatrix44* Transforms, const QStringList& Strings) const;
|
||
|
|
||
|
protected:
|
||
|
lcTexture* mTexture;
|
||
|
unsigned char* mBuffer;
|
||
|
int mRefCount;
|
||
|
|
||
|
std::map<QString, lcStringCacheEntry> mStrings;
|
||
|
};
|
||
|
|
||
|
extern lcStringCache gStringCache;
|