public static void main(String[] args) {
		try {
			Display.setDisplayMode(new DisplayMode(480, 360));
			Display.setTitle("CoffeeBlocks");
			Display.create();
		} catch (LWJGLException e) {
			e.printStackTrace();
			Display.destroy();
			System.exit(0);
		}
		
		shaderProgram = loadShaders("texture");
		translationMatrix = glGetUniformLocation(shaderProgram, "transformation");
		shaderType = glGetUniformLocation(shaderProgram, "type");
		
		InputStream i = null;
		ObjectReader reader = new ObjectReader();
		
		try {
			reader.readProject(i = new FileInputStream(new File(args[0])));
			i.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		Stage stage = reader.stage;
		
		System.out.println(stage);
		
		glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		glDisable(GL_DEPTH_TEST);
		glDisable(GL_LIGHTING);
		
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		glOrtho(0, 480, 360, 0, 0, 1);
		glMatrixMode(GL_MODELVIEW);
		
		boolean turbo = true;
		
		//double count = 0;
		//double initStart = System.currentTimeMillis();
		
		while (!Display.isCloseRequested()) {
			long start = System.currentTimeMillis();
			glClear(GL_COLOR_BUFFER_BIT);
			
			do {
				stage.step();
			} while (turbo && System.currentTimeMillis() - start < 1000 / 30);
			
			stage.draw();
			
			Display.update();
			Display.sync(30);
			
			//System.out.println(++count / ((System.currentTimeMillis() - initStart) / 1000.0));
		}
		Display.destroy();
	}