A different kind of menu question

Started by
-1 comments, last by wazoo69 22 years, 4 months ago
Hey, I'm working on a very small and cheesy menuing system in OpenGL for my little game, and I'm running into some weird effects.. Basically I've got two application state flags. My thinking is that I want the menu to be able to appear regardless of which state the game is in, then when the user returns to the game, it returns to the exact state he left it in...(as most games seem to do nowadays).. Anyways, I have no problems RENDERING my menu, but my problems arise from testing to see if the user has hit ESC in order to create/destroy the menu... I get weird results where sometimes the menu does what it's supposed to do, then others it doesn't seem to register the ESC key properly..(I'm using buffered DirectInput)..
    
if(bESC)
{
    if(dwCurrentAppState == MENU)
    {
	dwCurrentAppState = dwOldAppState;
		
    }else
    {
	dwOldAppState = dwCurrentAppState;
	dwCurrentAppState = MENU;
		
    }
	
    bESC = FALSE;
}
    
I can't have been the only person to come across this erratic behaviour...what have other people done?? Are you supposed to use some kind of timing code with your menus, to prevent this "nonregistering" from happening?? (I'm using the query perf. timer as normal to lock the framerate to 30fps).. thanks, Edited by - wazoo69 on December 17, 2001 8:50:24 PM
Learn about game programming!Games Programming in C++: Start to Finish

This topic is closed to new replies.

Advertisement