System.err.println("The display wasn't initialized correctly. :(");
Display.destroy();
System.exit(1);
}
EulerCamera cam = new EulerCamera((float) Display.getWidth() / (float) Display.getHeight(), -2.19f, 1.36f,
11.45f);
cam.setFieldOfView(60);
cam.applyPerspectiveMatrix();
setUpShaders();
setUpLighting();
setUpDisplayLists();
while (!Display.isCloseRequested()) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
cam.applyTranslations();
glUseProgram(shaderProgram);
glCallList(bunny);
glUseProgram(0);
cam.processMouse(1, 80, -80);
cam.processKeyboard(16, 1, 1, 1);
if (Mouse.isButtonDown(0)) {
Mouse.setGrabbed(true);
} else if (Mouse.isButtonDown(1)) {
Mouse.setGrabbed(false);