public synchronized void render() {
		int timePause;
		
		if (this.visible == false) {
			throw new MinuetoWindowInvalidStateException("Window is invisible");
		}
		
		if(this.isClosed()) {
			throw new MinuetoWindowInvalidStateException("Window is closed!");
		}

		this.frameCount++;

		if (this.frameCount == 50) {
			this.stopWatchCurrentFrameRate.stop();
			this.currentFrameRate = 50000.0 / this.stopWatchCurrentFrameRate
					.getTime();
			this.stopWatchCurrentFrameRate.reset();
			this.stopWatchCurrentFrameRate.start();
			this.frameCount = 0;
		}

		if (this.maxFrameRate > 0) {

			timePause = (int) (this.timeBetweenFrames - this.stopWatchMaxFrameRate
					.getTime());

			while (timePause > 10) {

				try {
					Thread.sleep(timePause / 2);
				} catch (InterruptedException ie) {

				}

				timePause = (int) (this.timeBetweenFrames - this.stopWatchMaxFrameRate
						.getTime());
			}

			while (this.stopWatchMaxFrameRate.getTime() < this.timeBetweenFrames) {

				Thread.yield();
			}
		}

		/* This should allow our fonts to be nicer, I think. */
		// this.graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
		// RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
		/* Releases the graphic pointer. We wont be needing it anymore. */
		this.graphics2D.dispose();

		/* Copies the backbuffer to the frontbuffer. */
		this.bufferStrategy.show();

		/*
		 * Sync the display on some systems. (on Linux, this fxes event queue
		 * problems).
		 */
		Toolkit.getDefaultToolkit().sync();

		/* Get a new graphicpointer */
		this.graphics2D = (Graphics2D) this.bufferStrategy
				.getDrawGraphics();

		this.stopWatchMaxFrameRate.reset();
		this.stopWatchMaxFrameRate.start();
	}