public void run() {
		preRender();
		
		long previousTime = System.nanoTime();
		double secondsPerTick = 1 / 60.0;
		double unprocessedSeconds = 0;
		boolean ticked = false;
		int fpsTemp = 0;
		long tickCount = 0;
		requestFocus();
		
		while (running) {
			long currentTime = System.nanoTime();
			unprocessedSeconds += (currentTime - previousTime) / 1000000000.0;
			previousTime = currentTime;
			
			while (unprocessedSeconds >= secondsPerTick) {
				unprocessedSeconds -= secondsPerTick;
				if(inputStopped && --inputStopCounter <= 0) {
					inputStopped = false;
					inputStopCounter = 0;
				}
				gameLoop.tick(input);
				input.tick();
				ticked = true;
				tickCount++;
				if (tickCount % 60 == 0) {
					fps = fpsTemp;
					fpsTemp = 0;
					/*if(printFPS) {
						gameLoop.printFPS();
					}*/
				}
			}

			if (ticked) {
				render();
				if (vSync)
					ticked = false;
				fpsTemp++;
			}
		}
	}