Cafu Engine
Font.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MATSYS_FONT_HPP_INCLUDED
8 #define CAFU_MATSYS_FONT_HPP_INCLUDED
9 
10 #include <string>
11 
12 
13 namespace MatSys { class RenderMaterialT; }
14 
15 
16 /// A class for MatSys-based font rendering.
17 /// The only requirement is that the MatSys in fully initialized (the global MatSys::Renderer pointer is set)
18 /// before any object of this class is instantiated.
19 class FontT
20 {
21  public:
22 
23  /// The constructor.
24  FontT(const std::string& MaterialName);
25 
26  /// The destructor.
27  ~FontT();
28 
29  /// The copy constructor.
30  FontT(const FontT& Other);
31 
32  /// The assignment operator.
33  FontT& operator = (const FontT& Other);
34 
35  /// Prints PrintString at (PosX, PosY) in color Color.
36  void Print(int PosX, int PosY, float FrameWidth, float FrameHeight, unsigned long Color, const std::string& PrintString);
37 
38  /// Accumulative printing functions. Faster if you have to call Print() a lot.
39  void AccPrintBegin(float FrameWidth, float FrameHeight);
40  void AccPrint(int PosX, int PosY, unsigned long Color, const std::string& PrintString);
41  void AccPrintEnd();
42 
43 
44  private:
45 
46  MatSys::RenderMaterialT* RenderMaterial;
47 };
48 
49 #endif
void Print(int PosX, int PosY, float FrameWidth, float FrameHeight, unsigned long Color, const std::string &PrintString)
Prints PrintString at (PosX, PosY) in color Color.
Definition: Font.cpp:47
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
A class for MatSys-based font rendering.
Definition: Font.hpp:19
~FontT()
The destructor.
Definition: Font.cpp:21
FontT & operator=(const FontT &Other)
The assignment operator.
Definition: Font.cpp:36
FontT(const std::string &MaterialName)
The constructor.
Definition: Font.cpp:15
void AccPrintBegin(float FrameWidth, float FrameHeight)
Accumulative printing functions. Faster if you have to call Print() a lot.
Definition: Font.cpp:55