Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 11:08:14 PM (15 years ago)
Author:
rgrieder
Message:

Cleanup in the GameStates (also moved debug overlay to the GraphicsManager).

Location:
code/branches/core5/src/libraries/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/Core.cc

    r5875 r5876  
    289289        inputManager_.reset(new InputManager());
    290290
    291         // load the CEGUI interface
     291        // Load the CEGUI interface
    292292        guiManager_.reset(new GUIManager(graphicsManager_->getRenderWindow(),
    293293            inputManager_->getMousePosition(), graphicsManager_->isFullScreen()));
     
    295295        bGraphicsLoaded_ = true;
    296296        GameMode::bShowsGraphics_s = true;
     297
     298        // Load some sort of a debug overlay (only denoted by its name, "debug.oxo")
     299        graphicsManager_->loadDebugOverlay();
    297300
    298301        // Create singletons associated with graphics (in other libraries)
  • code/branches/core5/src/libraries/core/GraphicsManager.cc

    r5855 r5876  
    130130    GraphicsManager::~GraphicsManager()
    131131    {
     132        Loader::unload(debugOverlay_.get());
     133
    132134        Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get());
    133135        // TODO: Destroy the console command
     
    322324    }
    323325
     326    void GraphicsManager::loadDebugOverlay()
     327    {
     328        // Load debug overlay to show info about fps and tick time
     329        COUT(4) << "Loading Debug Overlay..." << std::endl;
     330        debugOverlay_.reset(new XMLFile("debug.oxo"));
     331        Loader::open(debugOverlay_.get());
     332    }
     333
     334    /**
     335    @note
     336        A note about the Ogre::FrameListener: Even though we don't use them,
     337        they still get called. However, the delta times are not correct (except
     338        for timeSinceLastFrame, which is the most important). A little research
     339        as shown that there is probably only one FrameListener that doesn't even
     340        need the time. So we shouldn't run into problems.
     341    */
    324342    void GraphicsManager::update(const Clock& time)
    325343    {
  • code/branches/core5/src/libraries/core/GraphicsManager.h

    r5738 r5876  
    7171
    7272        void upgradeToGraphics();
     73        void loadDebugOverlay();
    7374        bool rendererLoaded() const { return renderWindow_ != NULL; }
    7475
     
    99100        Ogre::Viewport*     viewport_;                 //!< default full size viewport
    100101
    101         // XML files for the resources
     102        // XML files for the resources and the debug overlay
    102103        shared_ptr<XMLFile> resources_;                //!< XML with resource locations
    103104        shared_ptr<XMLFile> extResources_;             //!< XML with resource locations in the external path (only for dev runs)
     105        shared_ptr<XMLFile> debugOverlay_;             //!< XML with various debug overlays
    104106
    105107        // config values
Note: See TracChangeset for help on using the changeset viewer.