How do I get rid of the delay when my program ends

BlitzMax Forums/BlitzMax Programming/How do I get rid of the delay when my program ends

Argh, now I've got a new issue. When tabbing out and back, blitzmax resets the projection matrix, so my code to display everything the same regardless of video resolution breaks, and everything gets stuck in one small corner of the high res screen because it's rendered at 800x500 but should be stretched over 1920x1200.

I thought it was an easy fix. When switching from windowed to fullscreen, I just call my function that sets the projection matrix again after I set the graphics up. But for some reason, when tabbing back into the game, even though my code is in there for setting the projection matrix up again when the APPRESUME event occurs, it doesn't put things back the way they were.

It's almost as if BlitzMax is giving my app the APPRESUME event first, and then it gets around to setting up the graphics again afterwards.

Also, the events it triggers are weird. This is what I get when loading the game fullscreen, alt-tabbing out, then alt tabbing back in, and quitting:

DebugLog:EVENT_WINDOWMOVE
DebugLog:EVENT_WINDOWSIZE
DebugLog:EVENT_APPRESUME
DebugLog:EVENT_APPRESUME
[TAB OUT]
DebugLog:EVENT_APPSUSPEND
DebugLog:EVENT_APPSUSPEND
DebugLog:EVENT_APPSUSPEND
[TAB IN]
DebugLog:EVENT_APPRESUME
DebugLog:EVENT_APPRESUME

Why three suspend events and two resume events when the app is alt-tabbed out of?