forked from Bjwebb/opengl-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
80 lines (66 loc) · 1.52 KB
/
main.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
70
71
72
73
74
75
76
77
78
79
80
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
struct WVector
{
GLfloat x,y,z;
// GLfloat r,g,b;
};
struct WMaterial {
GLfloat ambient[4];
GLfloat diffuse[4];
GLfloat specular[4];
GLfloat shininess[1];
char* name;
};
struct WGroup {
GLuint* Indices;
int numIndices;
char* mtlname;
int mtl;
};
typedef struct tagOBJECT {
WVector pos;
WVector rot;
float angle;
int numGroups;
WGroup* groups;
int numMtl;
WMaterial* mtl;
bool ismtl;
WVector* Vertices;
WVector* Normals;
int numVertices, numNormals;
} OBJECT;
struct WALL
{
WVector max;
WVector min;
};
void you_compensate();
void draw_cube();
void SetupWorld(char* worldfile);
float getWorldX();
float getWorldZ();
float getWorldAngle();
void DrawWorld();
void boundCreate(OBJECT* objs, int num);
int boundCheck(float minX, float maxX, float minZ, float maxZ);
void wallsCreate(WALL* tmpWall, int numWalls);
bool wallCheck(float minX, float maxX, float minZ, float maxZ);
static GLfloat red[] = { 255, 0, 0 };
static GLfloat green[] = { 0, 255, 0 };
static GLfloat blue[] = { 0, 0, 255 };
static GLfloat white[] = { 255, 255, 255 };
static GLfloat black[] = { 0, 0, 0 };
static GLfloat yellow[] = { 255, 255, 0 };
static GLfloat purple[] = { 255, 0, 255 };
void buildFont();
void glPrint(const char *fmt, ...);