-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfont.h
69 lines (55 loc) · 1.9 KB
/
font.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// -----------------------------------------------------------------
// Learning Team B
// Members:
// Adam LeMmon
// Faith Satterthwaite
// Tom Fletcher
// Justin Ball
// CS 4280 – 11:30 am
// Final Project
// Dr. Rague
// Due: 12/06/12
// Version: 2.4
// -----------------------------------------------------------------
// We made five major improvements to this game
// 1) New controls
// 2) Enemy attack
// 3) HUD (heads up display)
// 4) Enemy health bars
// 5) New Weapon
// -----------------------------------------------------------------
#ifndef __FONT_H
#define __FONT_H
/*
FONT.H
The CFont class
Author: Kevin Hawkins
Date: 3/29/2001
Description: The CFont class. Currently only supports Bitmap fonts.
*/
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
class CFont
{
private:
unsigned int texID; // font texture id
unsigned int callList; // font display list
float r, g, b, a; // RGBA
int screenX, screenY; // screen coordinates
float xpos, ypos, zpos; // 3d coordinates
void LoadTexture(); // loads the TGA font texture
void CreateCallLists(); // creates the font display list
public:
CFont();
CFont(char *name, int size);
~CFont();
void Build(char *name, int size);
void ClearFont();
void Print(const char *str, ...);
void SetPos2D(int x, int y) { screenX = x; screenY = y; }
void SetPos3D(float x, float y, float z) { xpos = x; ypos = y; zpos = z; }
void SetRGB(float red, float green, float blue) { r = red; g = green; b = blue; a = 1.0; }
void SetRGBA(float red, float green, float blue, float alpha) { r = red; g = green; b = blue; a = alpha; }
};
#endif