mirror of
https://github.com/leozide/leocad
synced 2024-12-28 22:23:35 +01:00
40 lines
780 B
C++
40 lines
780 B
C++
#pragma once
|
|
|
|
class TexFont
|
|
{
|
|
public:
|
|
TexFont();
|
|
|
|
bool IsLoaded() const
|
|
{
|
|
return mTexture != nullptr;
|
|
}
|
|
|
|
lcTexture* GetTexture() const
|
|
{
|
|
return mTexture;
|
|
}
|
|
|
|
bool Initialize(lcContext* Context);
|
|
void Reset();
|
|
|
|
void PrintText(lcContext* Context, float Left, float Top, float Z, const char* Text) const;
|
|
void GetTriangles(const lcMatrix44& Transform, const char* Text, float* Buffer) const;
|
|
void GetGlyphTriangles(float Left, float Top, float Z, int Glyph, float* Buffer) const;
|
|
void GetStringDimensions(int* cx, int* cy, const char* Text) const;
|
|
|
|
protected:
|
|
struct
|
|
{
|
|
unsigned char width;
|
|
float left, right, top, bottom;
|
|
} mGlyphs[256];
|
|
|
|
lcTexture* mTexture = nullptr;
|
|
int mTextureWidth;
|
|
int mTextureHeight;
|
|
int mFontHeight;
|
|
};
|
|
|
|
extern TexFont gTexFont;
|
|
|