-
Notifications
You must be signed in to change notification settings - Fork 0
/
fonts.cpp
55 lines (47 loc) · 1.04 KB
/
fonts.cpp
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
#include <GL/gl.h>
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <windows.h>
#include "main.h"
#include "display.h"
#include "controls.h"
#include "start_screen.h"
#include "plane.h"
#define INT_GLUT_BITMAP_8_BY_13 1
#define INT_GLUT_BITMAP_9_BY_15 2
#define INT_GLUT_BITMAP_TIMES_ROMAN_10 3
#define INT_GLUT_BITMAP_TIMES_ROMAN_24 4
#define INT_GLUT_BITMAP_HELVETICA_10 5
#define INT_GLUT_BITMAP_HELVETICA_12 6
#define INT_GLUT_BITMAP_HELVETICA_18 7
void *fontStroke = GLUT_STROKE_ROMAN;
void *fontBitmap = GLUT_BITMAP_TIMES_ROMAN_24;
void renderBitmapString(
float x,
float y,
float z,
void *font,
char *string) {
char *c;
glRasterPos3f(x, y,z);
for (c=string; *c != '\0'; c++) {
glutBitmapCharacter(font, *c);
}
}
void renderStrokeFontString(
float x,
float y,
float z,
void *font,
char *string) {
char *c;
glPushMatrix();
glTranslatef(x, y,z);
glScalef(0.002f, 0.002f, 0.002f);
for (c=string; *c != '\0'; c++) {
glutStrokeCharacter(font, *c);
}
glPopMatrix();
}