public void run(){
		requestFocus();
		
		screenImage = new BufferedImage(getWidth() / SCALE, getHeight() / SCALE, BufferedImage.TYPE_INT_RGB);
		
		long startTime = System.nanoTime();
		long totalTime = startTime;
		double tickTime = 0;
		
		int numTicks = 0, numFrames = 0;
		
		if(Options.startFullScreen) fullScreenManager.setFullScreen();
		
		while(running){
			long timePassed = System.nanoTime() - totalTime; //hoeveel tijd er verstreken is sinds de vorige update
			totalTime += timePassed;
			tickTime += timePassed / 1000000.0;
			boolean shouldRender = false;
			
			while(tickTime > MS_PER_TICK){
				tickTime -= MS_PER_TICK;
				shouldRender = true;
				
				numTicks++;
				
				screen.update();
				input.update();
				
				if(input.escape.isPressed()) stop();
				if(input.fullScreen.isTapped()) fullScreenManager.switchFullScreen();
				
			}
			
			if(isShowing() && shouldRender){
				render();
				numFrames++;
			}
			
			if(numTicks >= 60){
				fps = numFrames;
				
				numTicks = 0;
				numFrames = 0;
			}
			
			fullScreenManager.update();
		}
		System.exit(-1); //stopt het hele programma
	}