Changeset 4066 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.cc
- Timestamp:
- May 5, 2005, 8:59:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.cc
r4065 r4066 19 19 20 20 #include "debug.h" 21 #include "text_engine.h" 21 22 22 23 using namespace std; … … 29 30 GraphicsEngine::GraphicsEngine () 30 31 { 32 this->bDisplayFPS = false; 31 33 this->setClassName ("GraphicsEngine"); 32 34 this->initVideo(); … … 263 265 } 264 266 } 265 266 void GraphicsEngine::displayFPS(bool dislay) 267 { 268 PRINTF(4)(""); 269 270 271 } 272 273 267 268 269 void GraphicsEngine::tick(float dt) 270 { 271 if( unlikely(this->bDisplayFPS)) 272 { 273 this->currentFPS = 1.0/dt; 274 if( unlikely(this->currentFPS > this->maxFPS)) this->maxFPS = this->currentFPS; 275 if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS; 276 277 // 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"); 284 } 285 } 286 287 void GraphicsEngine::displayFPS(bool display) 288 { 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
Note: See TracChangeset
for help on using the changeset viewer.