public void renderScene() {
		
		// quite and dirty frame counter
		this.clock.tick();
		this.fpsSum += this.clock.getDelta();
		if (++this.fpsCnt >= this.fpsAvg) {
			this.fpsCnt = 0;
			this.fps = String.format("FPS: %2.2f", (1.0 / (this.fpsSum / this.fpsAvg)));
			this.fpsSum = 0.0;
		}
		
	    // Clear the screen and depth buffer
	    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);	
		
	    // render layers in each camera
		for (Camera camera : cameras) {
			if (!camera.isActive()) {
				continue;
			}
			
			camera.applyTransform();
			for (int i = this.layers.size() - 1; i >= 0; --i) {
				this.layers.get(i).render(camera.getMask());
			}
		    
			for (RenderSubsystem rs : this.subSystems) {
				rs.render(camera.getMask());
			}
		}
		
		// draw overlays
		GL11.glMatrixMode(GL11.GL_PROJECTION);
		GL11.glLoadIdentity();
		GL11.glOrtho(0, 1.0, 0, 1.0 / getAspectRatio(), 1, -1);
		GL11.glMatrixMode(GL11.GL_MODELVIEW);		
		GL11.glViewport(0, 0, this.config.getWidth(), this.config.getHeight());
		
		this.overlayRoot.renderWithAspectRatio(0xFFFFFFFF, getAspectRatio());
//		this.overlayRoot.render(0xFFFFFFFF);
		
		// render frame counter
		GL11.glMatrixMode(GL11.GL_PROJECTION);
		GL11.glLoadIdentity();
		GL11.glOrtho(0, this.config.getWidth(), this.config.getHeight(), 0, 1, -1);
		GL11.glMatrixMode(GL11.GL_MODELVIEW);	
		
		GL11.glEnable(GL11.GL_TEXTURE_2D);
    	GL11.glEnable(GL11.GL_BLEND);
		GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
		GL11.glColor4d(1, 0, 1, 1);		
		font.drawString(5, this.config.getHeight() - 20, this.fps);		
		
	    Display.update();		
	
		if (Display.isCloseRequested()) {
			this.evtSrv.dispatchEvent(new SimpleEvent(WINDOW_CLOSE_REQUEST));
		}
	}