Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
Text.h
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2012 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10 
11 #ifndef TEXT_H
12 #define TEXT_H
13 
14 #include "Matrix.h"
15 
16 #if GLES_VERSION == 2
17 #include <GLES2/gl2.h>
18 #elif GLES_VERSION == 3
19 #include <GLES3/gl3.h>
20 #else
21 #error "GLES_VERSION must be defined as either 2 or 3"
22 #endif
23 
24 #include <string>
25 
26 namespace MaliSDK
27 {
34  class Text
35  {
36  private:
37  static const std::string textureFilename;
38  static const std::string vertexShaderFilename;
39  static const std::string fragmentShaderFilename;
40 
47  static const float scale;
48 
49 
50 
51  Matrix projectionMatrix;
52  int numberOfCharacters;
53  float *textVertex;
54  float *textTextureCoordinates;
55  float *color;
56  GLshort *textIndex;
57  int m_iLocPosition;
58  int m_iLocProjection;
59  int m_iLocTextColor;
60  int m_iLocTexCoord;
61  int m_iLocTexture;
62  GLuint vertexShaderID;
63  GLuint fragmentShaderID;
64  GLuint programID;
65  GLuint textureID;
66 
67  public:
68 
73  static const int textureCharacterWidth;
74 
79  static const int textureCharacterHeight;
86  Text(const char * resourceDirectory, int windowWidth, int windowHeight);
87 
91  virtual ~Text(void);
92 
98  void clear(void);
99 
110  void addString(int xPosition, int yPosition, const char *string, int red, int green, int blue, int alpha);
111 
117  void draw(void);
118  };
119 }
120 #endif /* TEXT_H */