/*
God.h
Written by Matthew Fisher

The God class glues the operating system, the graphics device, the application interface,
and the window manager together.  It is essentially the first and the last code that is executed.
*/

extern const int ScreenWidth;   //the full screen width and height
extern const int ScreenHeight;

class God {
public:
    void FreeMemory();
    void Init(HINSTANCE hInstance, int nCmdShow);           //initalize all the objects
    void MessageLoop(HINSTANCE hInstance, int nCmdShow);    //begin the main rendering loop

    void RenderFrame();             //render a new frame
    void CaptureFrame();            //capture the current frame
    void ResetGraphicsObjects();    //reset all objects (needed after the application loses focus)
    void HandleAltEnter();          //Alt+Enter has been hit; toggle full screen
    void FullScreenMouseChange();   //full-screen mode has been toggled; hide/display the mouse
    void HandleReSize();            //the screen has been resized

private:
    bool CaptureStarted,            //true if the user has stated that they wish to begin screen capture (by pressin C)
        FullScreen,                 //true if we're in full screen mode
        IgnoreReSize;               //if we just toggled full screen we'll get a message from WinMain telling us
                                    //the screen has been resized, but if this is true we already know and ignore the Win32 message.
    ScreenCapture Capture;          //interface through which we capture the screen into an AVI file if requested
    Win32WindowManager WM;          //the window manager; handles the application's main window
    GraphicsDevice *GD;             //the graphics device object that handles talking with the graphics card and rendering things
    AppInterface App;               //the application interface, which loads graphics objects and tells the graphics device what to render
};

Top