-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc.c
executable file
·61 lines (50 loc) · 1.58 KB
/
misc.c
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
/*
* Hostile Takeover:
* CS248 Final Project, Fall 2004
*
* Written by Jonathan Reeves
*
* A simple 3D video game demonstrating the use of OpenGL for graphics
* rendering with a number of advanced techniques and optimizations to make
* it interesting. See the README file which came with this package for more
* details. It also includes a list of sources which were consulted while
* building this software package.
*
*/
#include <GL/gl.h>
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
/* set up all the lights we'll be using */
void SetupLights(void){
GLfloat ambient1[4] = {0.5, 0.5, 1.0, 0.5};
GLfloat specular1[4] = {0.0, 0.0, 0.0, 0.0};
GLfloat diffuse1[4] = {0.0, 0.0, 0.0, 0.0};
GLfloat ambient0[4] = {0.8, 0.8, 0.8, 1.0};
GLfloat specular0[4] = {0.5, 0.5, 0.5, 1.0};
GLfloat diffuse0[4] = {0.4, 0.4, 0.4, 1.0};
/* set the position of the "sun" global variable */
position0[0] = 50.0;
position0[1] = 8.0;
position0[2] = 15.0;
glLightfv(GL_LIGHT0, GL_POSITION, position0);
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);
glLightfv(GL_LIGHT0, GL_SPECULAR, specular0);
glLightfv(GL_LIGHT1, GL_AMBIENT, ambient1);
glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1);
glLightfv(GL_LIGHT1, GL_SPECULAR, specular1);
}
/* destroy everything we created */
void Cleanup(void){
FontDestroyAll();
PlayerDestroy(sod);
TerrainDestroy(ground);
TerrainDestroy(water);
SkyboxDestroy(sky);
PListFree(plist);
AIFlockDestroy(flocks[0]);
AIFlockDestroy(flocks[1]);
exit(0);
}