text: //===============================================================================
  // @ Game.cpp
  // ------------------------------------------------------------------------------
  // Game core routines
  //
  // Copyright (C) 2008-2015 by James M. Van Verth and Lars M. Bishop.
  // All rights reserved.
  //
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  //
  //===============================================================================
  
  //-------------------------------------------------------------------------------
  //-- Dependencies ---------------------------------------------------------------
  //-------------------------------------------------------------------------------
  
  #include <stdlib.h>
  
  #include <IvRenderer.h>
  #include <IvClock.h>
  #include <IvRendererHelp.h>
  #include <IvVector4.h>
  #include <IvFileReader.h>
  
  #include "Game.h"
  #include "Player.h"
  
  //-------------------------------------------------------------------------------
  //-- Static Members -------------------------------------------------------------
  //-------------------------------------------------------------------------------
  
  //-------------------------------------------------------------------------------
  //-- Methods --------------------------------------------------------------------
  //-------------------------------------------------------------------------------
  
  //-------------------------------------------------------------------------------
  // @ IvGame::Create()
  //-------------------------------------------------------------------------------
  // Static constructor
  //-------------------------------------------------------------------------------
  bool
  IvGame::Create()
  {
      IvGame::mGame = new Game();
      return ( IvGame::mGame != 0 );
  
  }   // End of IvGame::Create()
  
  
  //-------------------------------------------------------------------------------
  // @ Game::Game()
  //-------------------------------------------------------------------------------
  // Constructor
  //-------------------------------------------------------------------------------
  Game::Game() : IvGame()
  {
      // init variables
      mPlayer = 0;            // main player object
  
  }   // End of Game::Game()
  
  
  //-------------------------------------------------------------------------------
  // @ Game::~Game()
  //-------------------------------------------------------------------------------
  // Destructor
  //-------------------------------------------------------------------------------
  Game::~Game()
  {
      delete mPlayer;
      mPlayer = 0;
  }   // End of Game::~Game()
  
  
  //-------------------------------------------------------------------------------
  // @ Game::PostRendererInitialize()
  //-------------------------------------------------------------------------------
  // Set up internal subsystems
  //-------------------------------------------------------------------------------
  bool 
  Game::PostRendererInitialize( )
  {
      // Set up base class 
      IvGame::PostRendererInitialize( );
      
      mPlayer = new Player();
      if (!mPlayer)
          return false;
  
      if (!mPlayer->ReadData())
      {
          delete mPlayer;
          return false;
      }
  
      // plug in a light
      ::IvSetDefaultLighting();
  
      return true;
  }   // End of Game::PostRendererInitialize()
  
  
  //-------------------------------------------------------------------------------
  // @ Game::Update()
  //-------------------------------------------------------------------------------
  // Main update loop
  //-------------------------------------------------------------------------------
  void
  Game::UpdateObjects( float dt )
  {
      // update player
      mPlayer->Update( dt );
      
  }   // End of Game::Update()
  
  
  //-------------------------------------------------------------------------------
  // @ Game::Render()
  //-------------------------------------------------------------------------------
  // Render stuff
  //-------------------------------------------------------------------------------
  void 
  Game::Render()                                  // Here's Where We Do All The Drawing
  {   
      // Reset The View
      ::IvSetDefaultViewer( -10.0f, 2.0f, 10.0f );
  
      // draw axes
      ::IvDrawAxes();
      
      // draw the main object
      mPlayer->Render();
  }
  
  