OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
FontTRLE.h
Go to the documentation of this file.
1 
8 #ifndef _FONT_TRLE_H_
9 #define _FONT_TRLE_H_
10 
11 #include <vector>
12 
13 #include "system/Shader.h"
14 
18 class FontTRLE {
19  public:
20  static void shutdown();
21 
22  static int initialize(std::string font);
23 
24  static unsigned int widthText(float scale, std::string s);
25 
26  static unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
27 
28  static void drawText(unsigned int x, unsigned int y, float scale,
29  glm::vec4 color, std::string s);
30 
31  static void drawTextWrapped(unsigned int x, unsigned int y, float scale,
32  glm::vec4 color, unsigned int maxWidth, std::string s);
33 
34  private:
35  static void setDefaultOffsets();
36  static void loadLPS(std::string f);
37  static void writeChar(unsigned int index, unsigned int xDraw, unsigned int yDraw, float scale,
38  std::vector<glm::vec2>& vertices, std::vector<glm::vec2>& uvs);
39 
40  static bool mFontInit;
41  static unsigned int mFontTexture;
42 
43  // 106 entries: (x, y, w, h, offset)
44  static int offsets[106][5];
45  static int defaultOffsets[106][5];
46 
49 };
50 
51 #endif
52 
static void setDefaultOffsets()
static void drawText(unsigned int x, unsigned int y, float scale, glm::vec4 color, std::string s)
Definition: FontTRLE.cpp:149
static int initialize(std::string font)
Definition: FontTRLE.cpp:28
Tomb Raider Level Editor Font loader.
Definition: FontTRLE.h:18
static bool mFontInit
Definition: FontTRLE.h:40
OpenGL Shader Implementation.
static unsigned int widthText(float scale, std::string s)
Definition: FontTRLE.cpp:128
static unsigned int heightText(float scale, unsigned int maxWidth, std::string s)
Definition: FontTRLE.cpp:175
static void loadLPS(std::string f)
Definition: FontTRLE.cpp:62
static void shutdown()
Definition: FontTRLE.cpp:25
static ShaderBuffer vertexBuffer
Definition: FontTRLE.h:47
static unsigned int mFontTexture
Definition: FontTRLE.h:41
static int offsets[106][5]
Definition: FontTRLE.h:44
static int defaultOffsets[106][5]
Definition: FontTRLE.h:45
static void drawTextWrapped(unsigned int x, unsigned int y, float scale, glm::vec4 color, unsigned int maxWidth, std::string s)
Definition: FontTRLE.cpp:208
static const float scale
Definition: Sprite.cpp:15
static ShaderBuffer uvBuffer
Definition: FontTRLE.h:48
static void writeChar(unsigned int index, unsigned int xDraw, unsigned int yDraw, float scale, std::vector< glm::vec2 > &vertices, std::vector< glm::vec2 > &uvs)
Definition: FontTRLE.cpp:91