GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TextRenderer.hpp
Go to the documentation of this file.
1 #ifndef RADIX_TEXT_RENDERER_HPP
2 #define RADIX_TEXT_RENDERER_HPP
3 
4 #include <string>
5 
6 #include <radix/World.hpp>
10 #include <radix/data/text/Text.hpp>
11 
12 namespace radix {
13 
14 class TextRenderer {
15 public:
16  TextRenderer(World& w, Renderer& ren);
17  void render(double dtime);
18 
23  void renderText(RenderContext &rc, Text text);
24 
31  int getTextWidth(std::string text, Font font);
32  static Matrix4f clipProjMat(const Entity &ent, const Matrix4f &view, const Matrix4f &proj);
33 
34 private:
37 
38  std::unique_ptr<RenderContext> renderContext;
39 
40  double time;
41 };
42 
43 } /* namespace radix */
44 
45 #endif /* RADIX_TEXT_RENDERER_HPP */
Renderer & renderer
Definition: TextRenderer.hpp:36
std::unique_ptr< RenderContext > renderContext
Definition: TextRenderer.hpp:38
World & world
Definition: TextRenderer.hpp:35
Definition: Font.hpp:11
Definition: GameController.hpp:7
void render(double dtime)
int getTextWidth(std::string text, Font font)
Meassures the width of text respecting the font.
Definition: TextRenderer.cpp:18
ECS entity, Component container It is created like this:
Definition: Entity.hpp:23
TextRenderer(World &w, Renderer &ren)
Definition: TextRenderer.cpp:12
static Matrix4f clipProjMat(const Entity &ent, const Matrix4f &view, const Matrix4f &proj)
Definition: Text.hpp:11
Definition: TextRenderer.hpp:14
void renderText(RenderContext &rc, Text text)
Renders a string to the screen using signed-distance field text rendering.
Definition: TextRenderer.cpp:22
double time
Definition: TextRenderer.hpp:40
Definition: RenderContext.hpp:15
Definition: Matrix4f.hpp:25
Definition: World.hpp:32
Main renderer - handles sub-renderers and provides low level render functions.
Definition: Renderer.hpp:35