-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.h
48 lines (34 loc) · 1.05 KB
/
helpers.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
#ifndef helpers_h
#define helpers_h
#include <GL/gl.h>
// One-time initialization function.
// Call this after OpenGL has been initialized.
void initHelperLibrary();
// Returns how much wall-clock time has elapsed since the helper library
// was initialized.
float getElapsedTime();
// Loads a texture from disk. PPM and JPG formats are supported.
// Exits program if there is any error.
GLuint loadTexture(char* name);
// Retrieves the object-rotation/translation matrix that is managed
// by the helper library.
GLdouble* getObjectMatrix();
// Retrieves the free-flight camera matrix that is managed
// by the helper library.
GLdouble* getCameraMatrix();
typedef struct
{
GLfloat* vertexArray;
GLfloat* normalArray;
GLfloat* texCoordArray;
GLfloat* colorArray;
GLuint* indexArray;
int numVertices;
int numIndices;
} Model;
// Loads a model from disk. OBJ format is supported.
// Exits program if there is any error.
Model* loadModel(char* name);
// Deallocates data structures associated with a model.
void freeModel(Model* model);
#endif