public void run() {
		initialize();
		Map<Integer, Boolean> keyStates = new HashMap<Integer, Boolean>();
		framesPerSecond = FPS;
		long lastFrame = System.nanoTime();
		while (running) {
			render();
			Display.update();
			if (isNewEvent(keyStates, Keyboard.KEY_L)) {
				if (earthLockRotationX == -1)
					earthLockRotationX = earth.getRotation();
				else
					earthLockRotationX = -1;
				earthLockRotationY = 0;
			}
			if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
				earthLockRotationX += 1;
			if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
				earthLockRotationX -= 1;
			if (Keyboard.isKeyDown(Keyboard.KEY_UP))
				earthLockRotationY += 1;
			if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
				earthLockRotationY -= 1;
			frameNum++;
			running = !Display.isCloseRequested();
			framesPerSecond = framesPerSecond * .95 + .05 * (1 / ((System.nanoTime() - lastFrame) / 1E9));
			lastFrame = System.nanoTime();
			Display.sync(FPS);
			if (isNewEvent(keyStates, Keyboard.KEY_Q) || isNewEvent(keyStates, Keyboard.KEY_ESCAPE)) {
				running = false;
			}
			keyStates.put(Keyboard.KEY_Q, Keyboard.isKeyDown(Keyboard.KEY_Q));
			keyStates.put(Keyboard.KEY_ESCAPE, Keyboard.isKeyDown(Keyboard.KEY_ESCAPE));
			keyStates.put(Keyboard.KEY_L, Keyboard.isKeyDown(Keyboard.KEY_L));
			keyStates.put(Keyboard.KEY_RIGHT, Keyboard.isKeyDown(Keyboard.KEY_RIGHT));
			keyStates.put(Keyboard.KEY_LEFT, Keyboard.isKeyDown(Keyboard.KEY_LEFT));
		}
		destroy();
	}