Changeset 4458 in orxonox.OLD for orxonox/trunk/src/lib/graphics/graphics_engine.cc
- Timestamp:
- Jun 1, 2005, 11:51:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4374 r4458 165 165 } 166 166 167 /** 168 \brief sets Fullscreen mode 169 \param fullscreen true if fullscreen, false if windowed 170 */ 167 171 void GraphicsEngine::setFullscreen(bool fullscreen) 168 172 { … … 171 175 } 172 176 177 /** 178 \brief sets the background color 179 \param red the red part of the background 180 \param blue the blue part of the background 181 \param green the green part of the background 182 \param alpha the alpha part of the background 183 */ 173 184 void GraphicsEngine::setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 174 185 { … … 290 301 } 291 302 292 303 /** 304 \brief ticks the Text 305 \param dt the time passed 306 */ 293 307 void GraphicsEngine::tick(float dt) 294 308 { 295 296 297 309 if( unlikely(this->bDisplayFPS)) 310 { 311 this->currentFPS = 1.0/dt; 298 312 if( unlikely(this->currentFPS > this->maxFPS)) this->maxFPS = this->currentFPS; 299 if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS; 300 301 char tmpChar1[20]; 302 sprintf(tmpChar1, "Current: %4.0f", this->currentFPS); 303 this->geTextCFPS->setText(tmpChar1); 304 char tmpChar2[20]; 305 sprintf(tmpChar2, "Max: %4.0f", this->maxFPS); 306 this->geTextMaxFPS->setText(tmpChar2); 307 char tmpChar3[20]; 308 sprintf(tmpChar3, "Min: %4.0f", this->minFPS); 309 this->geTextMinFPS->setText(tmpChar3); 310 } 311 } 312 313 if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS; 314 315 char tmpChar1[20]; 316 sprintf(tmpChar1, "Current: %4.0f", this->currentFPS); 317 this->geTextCFPS->setText(tmpChar1); 318 char tmpChar2[20]; 319 sprintf(tmpChar2, "Max: %4.0f", this->maxFPS); 320 this->geTextMaxFPS->setText(tmpChar2); 321 char tmpChar3[20]; 322 sprintf(tmpChar3, "Min: %4.0f", this->minFPS); 323 this->geTextMinFPS->setText(tmpChar3); 324 } 325 } 326 327 /** 328 \brief displays the Frames per second 329 \param display if the text should be displayed 330 331 \todo this is dangerous 332 */ 313 333 void GraphicsEngine::displayFPS(bool display) 314 334 { 315 316 317 318 319 320 321 322 323 324 325 326 327 328 } 329 330 335 if( display) 336 { 337 this->geTextCFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0); 338 this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT); 339 this->geTextCFPS->setPosition(5, 500); 340 this->geTextMaxFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0); 341 this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT); 342 this->geTextMaxFPS->setPosition(5, 530); 343 this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0); 344 this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT); 345 this->geTextMinFPS->setPosition(5, 560); 346 } 347 this->bDisplayFPS = display; 348 } 349 350
Note: See TracChangeset
for help on using the changeset viewer.