PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

game loop + windows task bar function

My Application can run smoothly using game loop, except when I click on task bar function (e.g. volume control) and my application exit unexpectedly.

and I notice that memory used hasn't been deleted yet,
after the unexpected exit.

I realise that i may need to stop gameloop from drawing on the screen but is there any way that I'll be able to know when to resume gameloop ?

If it is not caused by gameloop drawing on the window,
any idea what cause this abnormal behaviour ?
I do not understand what you ask exactly, but maybe you switch from your app without quitting.
Memory wasn't cleared?
It's strange. I use a lot of STL and "new" functions but even the game crashes all is cleared by Win.
Try to go Settings->Memory->RunningPrograms
to see If your app still not running on "background"
within my game's class I added:
OnSuspend() and OnResume()

for example, an excerpt of my main.h

Code:
protected:

virtual bool OnInitialize(); // Return true or false depending on success
virtual uint32_t GetSeconds();
virtual bool OnGameLoop(); // Game loop, return true to continue running or false to shutdown
virtual void OnStylusDown( Point stylus );
virtual void OnStylusUp( Point stylus );
virtual void OnStylusMove( Point stylus );
virtual void OnKeyDown( int key );
virtual void OnKeyUp( int key );
virtual void OnResume();
virtual void OnSuspend();