Added world loading and other various improvements
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#include <GL/freeglut.h>
|
||||
|
||||
#include "CrystalJohan.h"
|
||||
#include "CrystalPoint.h"
|
||||
#include <stdio.h>
|
||||
#include "Vector.h"
|
||||
|
||||
void configureOpenGL(void);
|
||||
|
||||
CrystalJohan* app;
|
||||
CrystalPoint* app;
|
||||
|
||||
bool justMoved = false;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
app = new CrystalJohan();
|
||||
app = new CrystalPoint();
|
||||
glutInit(&argc, argv);
|
||||
|
||||
configureOpenGL();
|
||||
@@ -26,6 +26,8 @@ int main(int argc, char* argv[])
|
||||
//Keyboard
|
||||
glutKeyboardFunc([](unsigned char c, int, int) { app->keyboardState.keys[c] = true; });
|
||||
glutKeyboardUpFunc([](unsigned char c, int, int) { app->keyboardState.keys[c] = false; });
|
||||
glutSpecialFunc([](int c, int, int) { app->keyboardState.special[c] = true; });
|
||||
glutSpecialUpFunc([](int c, int, int) { app->keyboardState.special[c] = false; });
|
||||
|
||||
//Mouse
|
||||
glutPassiveMotionFunc([](int x, int y)
|
||||
@@ -55,7 +57,7 @@ void configureOpenGL()
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutInitWindowSize(800, 600);
|
||||
glutCreateWindow("Crystal Point");
|
||||
glutFullScreen();
|
||||
//glutFullScreen();
|
||||
|
||||
//Depth testing
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@@ -81,8 +83,8 @@ void configureOpenGL()
|
||||
//glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
|
||||
//glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
|
||||
|
||||
//glEnable(GL_LIGHTING);
|
||||
//glEnable(GL_LIGHT0);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
glutSetCursor(GLUT_CURSOR_CROSSHAIR);
|
||||
}
|
||||
Reference in New Issue
Block a user