2017-07-19 14:20:32 -07:00
|
|
|
#pragma once
|
2011-09-07 21:06:51 +00:00
|
|
|
|
|
|
|
class TexFont
|
|
|
|
{
|
|
|
|
public:
|
2012-04-02 05:52:22 +00:00
|
|
|
TexFont();
|
2011-09-07 21:06:51 +00:00
|
|
|
|
2012-04-02 05:52:22 +00:00
|
|
|
bool IsLoaded() const
|
|
|
|
{
|
|
|
|
return mTexture != 0;
|
|
|
|
}
|
|
|
|
|
2017-03-25 12:29:28 -07:00
|
|
|
GLuint GetTexture() const
|
2012-04-02 05:52:22 +00:00
|
|
|
{
|
2017-03-25 12:29:28 -07:00
|
|
|
return mTexture;
|
2012-04-02 05:52:22 +00:00
|
|
|
}
|
2011-09-07 21:06:51 +00:00
|
|
|
|
2020-07-11 09:17:43 -07:00
|
|
|
bool Initialize(lcContext* Context);
|
|
|
|
void Reset();
|
2014-08-23 22:56:59 +00:00
|
|
|
|
2015-05-25 17:36:22 +00:00
|
|
|
void PrintText(lcContext* Context, float Left, float Top, float Z, const char* Text) const;
|
2018-08-19 20:27:58 -07:00
|
|
|
void GetTriangles(const lcMatrix44& Transform, const char* Text, float* Buffer) const;
|
2017-02-11 08:30:57 -08:00
|
|
|
void GetGlyphTriangles(float Left, float Top, float Z, int Glyph, float* Buffer) const;
|
2011-09-07 21:06:51 +00:00
|
|
|
void GetStringDimensions(int* cx, int* cy, const char* Text) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned char width;
|
|
|
|
float left, right, top, bottom;
|
2012-04-02 05:52:22 +00:00
|
|
|
} mGlyphs[256];
|
2011-09-07 21:06:51 +00:00
|
|
|
|
2012-04-02 05:52:22 +00:00
|
|
|
GLuint mTexture;
|
|
|
|
int mTextureWidth;
|
|
|
|
int mTextureHeight;
|
|
|
|
int mFontHeight;
|
2011-09-07 21:06:51 +00:00
|
|
|
};
|
|
|
|
|
2014-08-23 22:56:59 +00:00
|
|
|
extern TexFont gTexFont;
|
|
|
|
|