Not responding?

Hm so the problem I have is my game is not responding after a certain amount of time not being active (I mean window). After I refocus the window after certain periods of time, the game is not responding for some time. If the game was not focused for short amount of time, my game will start responding again after 2 seconds or something. But if the game was not focused for longer periods of time, after I focus it again, it isn’t responding and I need to cut the thread from inside eclipse to stop the game.

I thought this might be because I’m using VBO’s. Maybe they get deleted after some time or something?

EDIT:
It seems when I’m rendering when display is not active causes this not responding problem. When I stopped rendering when display is inactive, the problem went away.

In my game loop before updating&drawing I do this:


if (isHidden()) {
   continue;
}

Where isHidden is defined as:


private boolean isHidden()
{
	if (Display.isVisible()) {
		return false;
	}
	if (Display.isDirty()) {
		Color bg = getBackground();
		GL11.glClearColor(bg.r, bg.g, bg.b, bg.a);
		triggerDraw();
	}
	try {
		Thread.sleep(100);
	} catch (InterruptedException ie) {
		// ignore
	}
	return true;
}

That might do it?

Why would using VBOs cause your program to stop responding? Considering that thousands of developers use them, I’m sure they wouldn’t do that.

Post code.

mm
I’m was asking what could be the problem. On my other game I was using imidiate mode to render and this problem didn’t occur. So I thought it was worth mentioning.

VBOs don’t do that unless you seriously messed something up. Post code, no one can help if you don’t. This isn’t a bug with OpenGL, so we need to see your code because its buggy.