Free Electron
FontHoudini.h
Go to the documentation of this file.
1 
2 /* Copyright (C) 2003-2021 Free Electron Organization
3  Any use of this software requires a license. If a valid license
4  was not distributed with this file, visit freeelectron.org. */
5 
6 /** @file */
7 
8 #ifndef __opengl_FontHoudini_h__
9 #define __opengl_FontHoudini_h__
10 
11 namespace fe
12 {
13 namespace ext
14 {
15 
16 /**************************************************************************//**
17  @brief Houdini-direct implementations for FontI
18 
19  @ingroup opengl
20 *//***************************************************************************/
21 class FE_DL_EXPORT FontHoudini: public FontI,
22  public Initialize<FontHoudini>
23 {
24  public:
25 
26  class Phrase
27  {
28  public:
29  SpatialVector m_location;
30  Color m_color;
31  String m_text;
32  };
33 
34  FontHoudini(void);
35 virtual ~FontHoudini(void);
36 
37  void initialize(void);
38 
39 virtual I32 fontHeight(I32* a_pAscent,I32* a_pDescent)
40  {
41  if(a_pAscent)
42  {
43  *a_pAscent=m_fontAscent;
44  }
45  if(a_pDescent)
46  {
47  *a_pDescent=m_fontDescent;
48  }
49 
50  return m_fontAscent+m_fontDescent;
51  }
52 virtual I32 pixelWidth(String a_string);
53 
54 virtual void drawAlignedText(sp<Component> a_spDrawComponent,
55  const SpatialVector& a_location,
56  const String a_text,const Color &a_color);
57 
58 static void setRender(RE_Render* a_pRender)
59  { ms_pRender=a_pRender; }
60 
61 static void flush(void);
62 
63  private:
64 
65 static RE_Render* ms_pRender;
66 
67  I32 m_fontAscent;
68  I32 m_fontDescent;
69 
70  Real m_multiplication;
71 
72 static Array<Phrase> ms_phraseArray;
73 };
74 
75 } /* namespace ext */
76 } /* namespace fe */
77 
78 #endif /* __opengl_FontHoudini_h__ */
kernel
Definition: namespace.dox:3
General interface to a window.
Definition: FontI.h:20
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Special vector for color (RGBA)
Definition: Color.h:21
Automatically reference-counted string container.
Definition: String.h:128
Houdini-direct implementations for FontI.
Definition: FontHoudini.h:21
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53