| Home
| Previous
| Next
| Up

MGL_suspendAppCodesType

Declaration

typedef enum {
MGL_SUSPEND_APP = 0,
MGL_NO_SUSPEND_APP = 1
} MGL_suspendAppCodesType

Prototype In

mgraph.h

Description

Defines the return codes that the application can return from the suspend application callback registered with the MGL. The default value to be returned is MGL_SUSPEND_APP and this will cause the application execution to be suspended until the application is re-activated again by the user. During this time the application will exist on the task bar under Windows 95 and Windows NT in minimised form.

MGL_NO_SUSPEND_APP can be used to tell the MGL to switch back to the Windows desktop, but not to suspend the applications execution. This must be used with care as the suspend application callback is then responsible for setting a flag in the application that will stop the application from doing any rendering directly to the framebuffer while the application is minimised on the task bar (since the application no lonter owns the screen!). This return value is most useful for networked games that need to maintain network connectivity while the user has temporarily switched back to the Windows desktop. Hence you can ensure that you main loop continues to run, including networking and AI code, but no drawing occurs to the screen.

Note: The MGL ensures that your application will never be switched away from outside of a message processing loop. Hence as long as you do not process messages inside your drawing loops, you will never lose the active focus (and your surfaces) while drawing, but only during event processing. The exception to this is if the user hits Ctrl-Alt-Del under Windows NT/2000 which will always cause a switch away from the application immediately and force the surfaces to be lost.

Members

MGL_SUSPEND_APP | Suspend application execution until restored
MGL_NO_SUSPEND_APP | Don't suspend execution, but allow switch

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com