Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 5, 2005, 10:59:35 PM (19 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: added md2 file structures and modified the way the fps is displayed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.cc

    r4067 r4070  
    3131{
    3232  this->bDisplayFPS = false;
     33  this->minFPS = 9999;
     34  this->maxFPS = 0;
    3335  this->setClassName ("GraphicsEngine");
    3436  this->initVideo();
     
    276278         
    277279          // temporary, only for showing how fast the text-engine is
    278           char tmpChar[20];
    279           sprintf(tmpChar, "fps: %4.0f", this->currentFPS);
    280           this->geText->setPosition(0, 500);
    281           //this->geText->setText(tmpChar);
    282           //this->geText->setPosition(0, 420);
    283           this->geText->setText("TEST\nTEST2");
     280          char tmpChar1[20];
     281          sprintf(tmpChar1, "Current: %4.0f", this->currentFPS);
     282          this->geTextCFPS->setText(tmpChar1);
     283          char tmpChar2[20];
     284          sprintf(tmpChar2, "Max: %4.0f", this->maxFPS);
     285          this->geTextMaxFPS->setText(tmpChar2);
     286          char tmpChar3[20];
     287          sprintf(tmpChar3, "Min: %4.0f", this->minFPS);
     288          this->geTextMinFPS->setText(tmpChar3);
    284289        }
    285290}
     
    287292void GraphicsEngine::displayFPS(bool display)
    288293{
    289   this->geText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
    290   this->geText->setAlignment(TEXT_ALIGN_LEFT);
    291   this->bDisplayFPS = display;
    292 }
    293 
    294  
     294        if( display)
     295        {
     296                this->geTextCFPS = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     297                this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
     298                this->geTextCFPS->setPosition(0, 500);
     299                this->geTextMaxFPS = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     300                this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
     301                this->geTextMaxFPS->setPosition(0, 530);
     302                this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     303                this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
     304                this->geTextMinFPS->setPosition(0, 560);       
     305        }
     306        this->bDisplayFPS = display;
     307}
     308
     309 
Note: See TracChangeset for help on using the changeset viewer.