Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2008, 8:29:05 PM (16 years ago)
Author:
rgrieder
Message:
  • added a little text box to the HUD that says how much of the main loop we spend with rendering. (can easily be commented)
  • fixed a bug in KeyBinder.cc
Location:
code/branches/network/src/orxonox/hud
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/hud/HUD.cc

    r1414 r1422  
    7575        fpsText->setCaption("init");
    7676
     77        // creating text to display render time ratio
     78        rTRText = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "rTRText"));
     79        rTRText->show();
     80        rTRText->setMetricsMode(Ogre::GMM_PIXELS);
     81        rTRText->setDimensions(0.001, 0.001);
     82        rTRText->setPosition(10, 30);
     83        rTRText->setFontName("Console");
     84        rTRText->setCharHeight(20);
     85        rTRText->setCaption("init");
     86
    7787        // create energy bar
    7888        energyBar = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "energyBar"));
     
    99109        container->setMetricsMode(Ogre::GMM_RELATIVE);
    100110        container->addChild(fpsText);
     111        container->addChild(rTRText);
    101112
    102113        energyBar->init(0.01, 0.94, 0.4, container);
     
    133144        float fps = GraphicsEngine::getSingleton().getAverageFPS();
    134145        fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps));
     146    }
     147
     148    void HUD::setRenderTimeRatio(float ratio)
     149    {
     150      rTRText->setCaption("Render time ratio: " + Ogre::StringConverter::toString(ratio));
    135151    }
    136152
  • code/branches/network/src/orxonox/hud/HUD.h

    r1414 r1422  
    4949        Ogre::OverlayContainer* container;
    5050        Ogre::TextAreaOverlayElement* fpsText;
     51        Ogre::TextAreaOverlayElement* rTRText;
    5152        BarOverlayElement* energyBar;
    5253        BarOverlayElement* speedoBar;
     
    6061        void addRadarObject(Vector3 pos);
    6162        RadarObject* getFirstRadarObject();
     63        void setRenderTimeRatio(float ratio);
    6264
    6365        static HUD* instance_s;
Note: See TracChangeset for help on using the changeset viewer.