/*
AppInterface.cpp
Written by Matthew Fisher

Serves as an interface between the God class and the current application.
See AppInterface.h for a full description of the AppInterface class and its member functions/variables.
*/

//All source files include Main.h
#include "Main.h"

void AppInterface::Init(GraphicsDevice &GD, WindowManager &WM)
{
    c1 = new MainControl;   //this MainControl object will receive all our initalization/rendering calls
    c1->Init(GD, WM);       //Initalize c1 (loads meshes, textures, etc.)
}

void AppInterface::ReInit(GraphicsDevice &GD, WindowManager &WM)
{
    c1->ReInit(GD, WM);     //If data (such as textures, meshes, etc.) were lost, restore them
                            //This happens when our window loses focus
}

void AppInterface::Render(GraphicsDevice &GD, WindowManager &WM)
{
    c1->Render(GD, WM);     //Render the current frame
}

void AppInterface::ResetAllDevices(GraphicsDevice &GD, WindowManager &WM)
{
    //If any devices need resetting, they can be done here.  However, almost all objects can be
    //reset in ReInit, so normally nothing needs to be done here.
}

void AppInterface::End()
{
    c1->FreeMemory();   //tell the MainControl to release all its data
    delete c1;          //kill c1
}

Top