private void run()
	{		
		init();
		
		log("Initializing game");
		game.init();
		System.out.println();
		
		boolean running = true;
		long time = 0, lastTime = 0, currentFPSSample = 0;
		float delta = 0, fps = 0;
		float[] fpsSamples = new float[targetFPS/2];
		
		while(running)
		{
			if(Display.wasResized())
			{
				CobaltApp.width = Display.getWidth();
				CobaltApp.height = Display.getHeight();
				game.resize(width, height);
				glViewport(0, 0, width, height);
			}
			
			if(Display.isCloseRequested())
				running = false;
			
			// Input Stuff
			Input.update();
			
			if(Input.isKeyPressed(debugKey))
				debug = !debug;
			
			if(Input.isKeyPressed(screenshotKey))
				CobaltUtil.screenshot();
			
			// Timing Stuff
			time = System.nanoTime();
			delta = (time - lastTime)/1000000f;
			fps = 1f/delta * 1000;
			lastTime = time;
			
			fpsSamples[(int) (currentFPSSample++ % fpsSamples.length)] = fps;
			
			game.update(delta);
			
			// Rendering Stuff
			glClear(GL_COLOR_BUFFER_BIT);
			glClearColor(clearR, clearG, clearB, 1f);

			batch.begin();
			game.render(batch);
			
			if(debug)
			{
				batch.draw("Width: " + width, 10, height * 2 - 65, 1, CoreGame.camera);
				batch.draw("Height: " + height, 10, height * 2 - 115, 1, CoreGame.camera);
				batch.draw("Camera Position: [" + CoreGame.camera.getX() + "," + CoreGame.camera.getY() + "]", 10, height * 2 - 165, 1, CoreGame.camera);
				batch.draw("Draw calls: " + batch.maxDrawCalls, 10, height * 2 - 215, 1, CoreGame.camera);
				batch.draw("Max Batch size: " + batch.maxSize, 10, height * 2 - 265, 1, CoreGame.camera);
				batch.draw("FPS: " + (int)CobaltMath.avg(fpsSamples), 10, height * 2 - 315, 1, CoreGame.camera);
			}
			
			batch.end();
			
			Display.update();
			Display.sync(targetFPS);
		}
		
		System.out.println();
		shutDown();
	}