-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.cpp
More file actions
50 lines (37 loc) · 976 Bytes
/
Copy pathdisplay.cpp
File metadata and controls
50 lines (37 loc) · 976 Bytes
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
#include "main.h"
static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glLoadIdentity (); /* clear the matrix */
gluLookAt (LocX, LocY, LocZ, rotX, rotY, rotZ, 0.0, 1.0, 0.0); //this controls the nav.
update();
make_Maze(); // draw the maze
/* draw gun */
if( flame ) { // Draw gun shooting
//fuel = max_fuel;
glClear(GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0, -1.5, -2);
glColor3f( 0.0, 0.0, 0.0 );
make_Gun();
flame = false;
}
else {
glClear(GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glColor3f( 0.0, 0.0, 0.0 );
glTranslatef(0, -1.2, -2);
make_Gun();
}
/* draw fuel indicator */
glClear(GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0, -2, -5);
glScalef(10*((GLfloat)fuel/max_fuel), 0.2f, 0.2f);
glRotatef(45, 1, 0, 0);
make_Life();
glFlush ();
glutSwapBuffers();
glFinish();
}