#include <GL/gl.h>
-#include <string.h>
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "assimp_types.h"
#include "assimp_types.h"
-char* getGlInfoString();
+char* getGlInfoString(void);
void dumpScene(FILE* stream, const AiScene* scene);
void dumpNode(FILE* stream, const AiNode* node);
+++ /dev/null
-#include <GL/gl.h>
-
-void initRender() {
- // Set the clear colour to black
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-
- GLfloat light0_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
- GLfloat light0_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
- GLfloat light0_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
- GLfloat light0_position[] = {5.0f, 10.0f, 10.0f, 1.0f};
-
- glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, light0_specular);
- glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
-
- glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0f);
- glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05f);
- glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.001f);
-}
-
-void resizeStage(GLsizei width, GLsizei height) {
- if (height == 0)
- height = 1;
-
- // Set device viewport dimensions
- glViewport(0, 0, width, height);
- // Switch to projection matrix
- glMatrixMode(GL_PROJECTION);
- // Reset the projection matrix
- glLoadIdentity();
-
- GLfloat aspectRatio = (GLfloat) width / (GLfloat) height;
-
- glOrtho(-8.0, 8.0, -8.0/aspectRatio, 8.0/aspectRatio, 128.0, -128.0);
-
- glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
- glRotatef(45.0f, 0.0f, 1.0f, 0.0f);
-
- glMatrixMode(GL_MODELVIEW);
-}
+++ /dev/null
-#ifndef GLUT_JANITOR_H_
-#define GLUT_JANITOR_H_
-
-#include <GL/gl.h>
-
-void initRender();
-void resizeStage(GLsizei width, GLsizei height);
-
-#endif
#include <GL/gl.h>
#include <assimp/cimport.h>
-
#include <stdio.h> // TODO remove
#include "level.h"
const AiScene* levelScene;
-void initLevel();
+void initLevel(void);
void setImage(TgaImage* image);
const AiScene* importScene(const char* path);
#include <stdio.h>
#include "debugutil.h"
-#include "glut_janitor.h"
-#include "render.h"
#include "level.h"
#include "performance.h"
+#include "render.h"
+#include "ui.h"
int main(int argc, char** argv) {
glutInit(&argc, argv);
-#include <time.h>
-#include <stdio.h> // TODO remove
#include <stdbool.h>
+#include <stdio.h> // TODO remove
+#include <time.h>
typedef struct timespec Timepoint;
#ifndef PERFORMANCE_H_
#define PERFORMANCE_H_
-void initPerformanceMetering();
-void frameRendered();
+void initPerformanceMetering(void);
+void frameRendered(void);
#endif
#include <GL/glut.h>
#include "level.h"
-#include "typedefs.h"
#include "performance.h"
#include "render.h"
+#include "typedefs.h"
const float AXIS_RADIUS = 5.0f;
+void initRender() {
+ glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+
+ GLfloat light0_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
+ GLfloat light0_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ GLfloat light0_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ GLfloat light0_position[] = {5.0f, 10.0f, 10.0f, 1.0f};
+
+ glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
+ glLightfv(GL_LIGHT0, GL_SPECULAR, light0_specular);
+ glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
+
+ glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0f);
+ glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05f);
+ glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.001f);
+}
+
void renderScene() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
#include "assimp_types.h"
-void renderScene();
-void drawAxes();
+void initRender(void);
+void renderScene(void);
+void drawAxes(void);
void drawSceneRecursive(const AiScene* scene, const AiNode* node);
#endif
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
#include "tga.h"
--- /dev/null
+#include <GL/gl.h>
+
+void resizeStage(GLsizei width, GLsizei height) {
+ if (height == 0)
+ height = 1;
+
+ // Set device viewport dimensions
+ glViewport(0, 0, width, height);
+ // Switch to projection matrix
+ glMatrixMode(GL_PROJECTION);
+ // Reset the projection matrix
+ glLoadIdentity();
+
+ GLfloat aspectRatio = (GLfloat) width / (GLfloat) height;
+
+ glOrtho(-8.0, 8.0, -8.0/aspectRatio, 8.0/aspectRatio, 128.0, -128.0);
+
+ glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
+ glRotatef(45.0f, 0.0f, 1.0f, 0.0f);
+
+ glMatrixMode(GL_MODELVIEW);
+}
--- /dev/null
+#ifndef GLUT_JANITOR_H_
+#define GLUT_JANITOR_H_
+
+#include <GL/gl.h>
+
+void resizeStage(GLsizei width, GLsizei height);
+
+#endif