LWJGL: how to delay between states

Hi,

I am trying to do an intro similar to those like any other game, and I have it working but I want a delay on the image so that it stays on screen for longer.

This is my state code:

	private void render() {
		switch (state) {
		case INTRO:
			IntroState.draw();
			state = State.MAIN_MENU;
			break;
		case MAIN_MENU:
			glColor3f(0.0f, 0.0f, 1.0f);
			glRectf(0, 0, width, height);
			break;
		case GAME:
			gameState.draw();
			break;
		case RAND:
			new RandomTerrain();
			break;
		}
	}

I am trying to use this code:

			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

but if I put it in the INTRO state it just delays the intro being shown, and if I put it in the MAIN_MENU state, it sort of works, but I need a better way of doing it.

Thanks,

  • Dan