private void run(){
		isRunning=true;
		
		int frames=0;
		double frameCounter=0;
		
		game.init();
		
		double lastTime = Time.getTime();
		double unprocessedTime=0; // Keeps track of how much time still needs to be processed (IN SECONDS).
		
		// MAIN GAME LOOP:
		while(isRunning){
			boolean render=false;
			
			double startTime = Time.getTime();
			double passedTime = startTime-lastTime;
			lastTime = startTime;
			
			unprocessedTime += passedTime;
			frameCounter+=passedTime;
			
			// Update loop:
			// For the amount of frame cycles it took to render the last frame, update the game for that amount of cycles.
			while(unprocessedTime > frameTime){
				render=true;
				
				unprocessedTime -= frameTime;
				
				if(Window.isCloseRequested())
					stop();
						
				game.input(frameTime);
				Input.update();
				
				game.update(frameTime);
				
				// Frame counter update:
				if(frameCounter >= 1.0){
					System.out.println(frames);
					frames=0;
					frameCounter=0;
				}
			}
			
			if(render){
				game.render(renderingEngine);
				Window.render();
				frames++;
			}else
				try {
					Thread.sleep(1);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
		}
		
		cleanUp();
	}