public class Main {
private long lastframe;
private Camera cam;
public Main() {
init();
run();
cleanup();
}
public void init() {
try {
Display.setDisplayMode(new DisplayMode(800, 600));
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
Camera.init(0, 0, 0, 0, 0, 0, 70, Display.getWidth()/Display.getHeight(), 0.00000001f, 100);
Game.init();
}
public void run() {
while (!Display.isCloseRequested()) {
long time = ((Sys.getTime() * 1000) / Sys.getTimerResolution());
int delta = (int) (time - lastframe);
lastframe = time;
Game.update(delta);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
Game.render();
cam.useTraits();
Display.update();
Display.sync(60);
}
}
public void cleanup() {
Display.destroy();
}
public static void main(String[] args) {
new Main();
}
}