@Override
	public void display(GLAutoDrawable drawable) {

		gl = drawable.getGL();
		
		// Enable VSync
		gl.setSwapInterval(1);
		
		// Setup the drawing area and shading mode
		gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		gl.glShadeModel(GL.GL_SMOOTH); // try setting this to GL_FLAT and see
		// what happens.

		gl.glEnable(GL.GL_DEPTH_TEST);
		gl.glEnable(GL.GL_LIGHTING);
		gl.glEnable(GL.GL_POINT_SMOOTH);
		gl.glEnable(GL.GL_LINE_SMOOTH);
		gl.glEnable(GL.GL_POLYGON_SMOOTH);
		gl.glEnable(GL.GL_COLOR_MATERIAL);
		
		// World light
		float[] ambientWorld = { 1f, 1f, 1f, 1f };
		// float[] ambientWorld = { 0.0f, 0.0f, 0.0f, 0.0f };
		gl.glLightModelfv(GL.GL_LIGHT_MODEL_AMBIENT, ambientWorld, 0);

		resetMaterial();

		// Clear the drawing area
		gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

		// reset variables
		_transparencyEnabled = false;

		// Reset the current matrix to the "identity"

		gl.glLoadIdentity();
		Application.getGame().getCamera().getView();

		// List<GameObject> objects = get3DObjectList();

		List<GameObject> objects = Application.getGame().getObjectsToRender();

		List<ModelSubset> orderedSubs = _subEngine.orderSubsetsInList(objects);

		for (ModelSubset sub : orderedSubs) {
			renderSubset(sub);
		}

		// for (GameObject object : objects) {
		// _lightsMgr.setProperLights(object, gl);
		// renderObject3D(object);
		// }

		// long oldtime = System.nanoTime();

		enable2D();

		// long dt = System.nanoTime() - oldtime;
		// System.out.println("Rendering: " + (double)dt/1000000000);

		objects = get2DObjectList();

		for (GameObject object : objects) {
			renderObject2D(object);
		}

		disable2D();

		List<String> texts = Application.getGame().getTextToRender();

		renderer.beginRendering(drawable.getWidth(), drawable.getHeight());
		renderer.setSmoothing(true);

		for (String str : texts) {
			renderer.draw(str, drawable.getWidth()/3, drawable.getHeight()/2);
		}
		
		renderer.endRendering();

		// Flush all drawing operations to the graphics card
		gl.glFlush();

	}