Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/text_engine/text_engine.h @ 5343

Last change on this file since 5343 was 5343, checked in by bensch, 19 years ago

orxonox/trunk: split open the text-engine

File size: 1.4 KB
Line 
1/*!
2 * @file text_engine.h
3  *  Definition of textEngine, the Font and the Text
4
5    Text is the text outputed.
6    Font is a class that loads a certain ttf-file with a specific height into memory
7    TextEngine is used to manage the all the different Fonts that might be included
8
9    for more information see the specific classes.
10
11    !! IMPORTANT !! When using ttf fonts clear the license issues prior to
12   adding them to orxonox. This is really important, because we do not want
13   to offend anyone.
14*/
15
16#ifndef _TEXT_ENGINE_H
17#define _TEXT_ENGINE_H
18
19#include "base_object.h"
20#include "font.h"
21#include "text.h"
22
23#include "vector.h"
24
25// FORWARD DECLARATION
26class PNode;
27class Font;
28
29///////////////////
30/// TEXT-ENGINE ///
31///////////////////
32//! A singleton Class that operates as a Handler for generating and rendering Text in 2D
33class TextEngine : public BaseObject
34{
35 public:
36  virtual ~TextEngine();
37  /** @returns a Pointer to the only object of this Class */
38  inline static TextEngine* getInstance() { if (!singletonRef) singletonRef = new TextEngine();  return singletonRef; };
39
40  Text* createText(const char* fontFile,
41                   unsigned int fontSize = TEXT_DEFAULT_SIZE,
42                   int textType = TEXT_RENDER_DYNAMIC);
43
44  void debug() const;
45
46 private:
47  TextEngine();
48  static TextEngine* singletonRef;
49
50  // general
51  static void enableFonts();
52  static void disableFonts();
53  static bool checkVersion();
54};
55
56#endif /* _TEXT_ENGINE_H */
Note: See TracBrowser for help on using the repository browser.