/* MainControl.h Written by Matthew Fisher MainControl includes everything that changes often between applications, such as what meshes to load, and also determines what is rendered each frame. This specific mesh class demonstates many things. Firstly, it uses a CreateCylinder function to render a bendy tube following an arbitrary function. Secondly, it demonstrates using multiple cameras in one scene. Thirdly, it uses an Indicator class to simplifying drawing spheres, cylinders, and cameras. The Indicator class draws the other camera (the one you're not looking through) and the position, normal, tangent, and torsion vectors along the spring curve mesh. It also demonstrates capturing the screen (press P.) */ class MainControl { public: ~MainControl() {FreeMemory();} void FreeMemory(); void InitCentralMesh(GraphicsDevice &GD); //initalizes the shape ring void ReInit(GraphicsDevice &GD, WindowManager &WM); //called after we lose focus, telling us to restore //our textures and other data that may have been list void Init(GraphicsDevice &GD, WindowManager &WM); //called only one at the beginning of our application void Render(GraphicsDevice &GD, WindowManager &WM); //called each frame private: float CurvePos; //the position along the helix curve we're currently looking at int CurCamera; //the camera we're looking through Indicator Ind; //the indicator class, used to easily draw the camera and curve vectors Mesh CentralMesh; //the mesh we're looking at Camera C[2]; //the two cameras we use MatrixController MC[2]; //the world/view/perspective matrices (one for each camera) float Time; //the current time, in seconds };