File: GLFont.h

package info (click to toggle)
blockout2 2.4%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 5,492 kB
  • sloc: cpp: 8,694; ansic: 147; makefile: 106
file content (35 lines) | stat: -rw-r--r-- 653 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// -----------------------------------------------
// Simple 2D font
// -----------------------------------------------
#include "SDL_opengl.h"

#ifndef _GLFONT2DH_
#define _GLFONT2DH_

class GLFont2D {

public:

  // Default constructor
  GLFont2D();
  
  // Initialise the font
  // return 1 when success, 0 otherwise
  int RestoreDeviceObjects(int srcWidth,int scrHeight);
  
  // Draw a 2D text (in screen coordinates)
  void DrawText(int x,int y,char *text);

  // Release any allocated resource
  void InvalidateDeviceObjects();

private:

  GLuint  texId;
  int     fWidth;
  int     fHeight;
  GLfloat pMatrix[16];

};

#endif /* _GLFONT2DH_ */