Hi!

I want my windowed game to stop fully by deactivating the window. Therefore i've written this function:

Code:
function pause()
{
	my = NULL;
	while (1)
	{
		if (!window_focus) freeze_mode = 1;
		 else freeze_mode = 0;	
		
		wait(-1);
	}
}


It works, the game stops by deactivating and continues by activating the window.

But the engine is still working in the background, i don't know why. I have running two functions at the same time, the main-loop and the pause-loop. the main-loop stops and the pause-loop should not need many ressources.
So, what the hell does acknex and how can I stop it?