Skip to main content
GameDev.net gamedev.net
🔒 Locked

Get application state.

Started by googa Apr 26, 2006 at 1:15 AM 1 replies 850+ views
Original Post
googa
googa
Hi, I'm programming a game here, and I have a problem: How can get the current application state (active/inactive) from within the game loop. (Windowed and full-screen). This is probably a very easy question, but I tried google in vain. All I want is a function like: GetApplicationState(); // returns a Boolean value (active / inactive) Thanks.
What about an Addictive FREE Turn-Based Puzzle/Strategy Game, with a Growing Community Available to Play right now?<a href="http://www.wonderquest.co.nr"><( ) -Hurrahh!/a> <a href="http://www.wonderquest.co.nr"><( ) -Yes!/a> <a href="http://www.wonderquest.co.nr"><( ) -Ai Caramba!/a>
Enselic
Enselic
You can catch the WM_ACTIVATE message and have a bool in your app keeping track of if the last WM_ACTIVATE was of the inactivate or activate type. Then you check agains this bool in your loop.
googa
googa
Thanks Enselic, I was not handling the g_bActive variable properly in my game. I didn't know which message to use.
What about an Addictive FREE Turn-Based Puzzle/Strategy Game, with a Growing Community Available to Play right now?<a href="http://www.wonderquest.co.nr"><( ) -Hurrahh!/a> <a href="http://www.wonderquest.co.nr"><( ) -Yes!/a> <a href="http://www.wonderquest.co.nr"><( ) -Ai Caramba!/a>

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.