Changeset 5346 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Oct 10, 2005, 1:17:11 AM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r5344 r5346 115 115 // looking if we are in fullscreen-mode 116 116 const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); 117 if (strchr(fullscreen, '1') )117 if (strchr(fullscreen, '1') || strcasestr(fullscreen, "true")) 118 118 this->fullscreenFlag = SDL_FULLSCREEN; 119 120 121 119 122 120 // looking if we are in fullscreen-mode 123 121 const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0"); 124 if (strchr(textures, '1') )122 if (strchr(textures, '1') || strcasestr(textures, "true")) 125 123 this->texturesEnabled = true; 126 124 else … … 138 136 /** 139 137 * initializes the Video for openGL. 140 141 142 */138 * 139 * This has to be done only once when starting orxonox. 140 */ 143 141 int GraphicsEngine::initVideo(unsigned int resX, unsigned int resY, unsigned int bbp) 144 142 { … … 209 207 /** 210 208 * Sets the GL-attributes 211 */209 */ 212 210 int GraphicsEngine::setGLattribs() 213 211 { … … 284 282 * @param height The height of the window 285 283 * @param bpp bits per pixel 286 */284 */ 287 285 int GraphicsEngine::setResolution(int width, int height, int bpp) 288 286 { … … 323 321 * @param green the green part of the background 324 322 * @param alpha the alpha part of the background 325 */323 */ 326 324 void GraphicsEngine::setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 327 325 { … … 332 330 * Signalhandler, for when the resolution has changed 333 331 * @param resizeInfo SDL information about the size of the new screen size 334 */332 */ 335 333 int GraphicsEngine::resolutionChanged(const SDL_ResizeEvent& resizeInfo) 336 334 { … … 431 429 432 430 /** 433 * leaves the 2DMode again also \see Font::enter2DMode()434 */431 * leaves the 2DMode again also @see Font::enter2DMode() 432 */ 435 433 void GraphicsEngine::leave2DMode() 436 434 { … … 446 444 /** 447 445 * stores the GL_matrices 448 */446 */ 449 447 void GraphicsEngine::storeMatrices() 450 448 { … … 465 463 /** 466 464 * outputs all the Fullscreen modes. 467 */465 */ 468 466 void GraphicsEngine::listModes() 469 467 { … … 515 513 * ticks the Text 516 514 * @param dt the time passed 517 */518 515 */ 516 void GraphicsEngine::tick(float dt) 519 517 { 520 518 if( unlikely(this->bDisplayFPS)) … … 552 550 553 551 /** 554 * 552 * displays the Frames per second 555 553 * @param display if the text should be displayed 556 557 @todo this is dangerous558 554 */ 559 555 void GraphicsEngine::displayFPS(bool display) 560 556 { 561 if( display)562 {563 557 #ifndef NO_TEXT 564 if (this->geTextCFPS == NULL) 565 { 566 this->geTextCFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 567 this->geTextCFPS->setName("curFPS"); 568 this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT); 569 this->geTextCFPS->setAbsCoor2D(5, 15); 570 } 571 if (this->geTextMaxFPS == NULL) 572 { 573 this->geTextMaxFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 574 this->geTextMaxFPS->setName("MaxFPS"); 575 this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT); 576 this->geTextMaxFPS->setAbsCoor2D(5, 40); 577 } 578 if (this->geTextMinFPS == NULL) 579 { 580 this->geTextMinFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 581 this->geTextMinFPS->setName("MinFPS"); 582 this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT); 583 this->geTextMinFPS->setAbsCoor2D(5, 65); 584 } 558 if( display ) 559 { 560 if (this->geTextCFPS == NULL) 561 { 562 this->geTextCFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 563 this->geTextCFPS->setName("curFPS"); 564 this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT); 565 this->geTextCFPS->setAbsCoor2D(5, 15); 566 } 567 if (this->geTextMaxFPS == NULL) 568 { 569 this->geTextMaxFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 570 this->geTextMaxFPS->setName("MaxFPS"); 571 this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT); 572 this->geTextMaxFPS->setAbsCoor2D(5, 40); 573 } 574 if (this->geTextMinFPS == NULL) 575 { 576 this->geTextMinFPS = new Text("fonts/arial_black.ttf", 15, TEXT_RENDER_DYNAMIC); 577 this->geTextMinFPS->setName("MinFPS"); 578 this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT); 579 this->geTextMinFPS->setAbsCoor2D(5, 65); 580 } 581 } 582 else 583 { 584 delete this->geTextCFPS; 585 this->geTextCFPS = NULL; 586 delete this->geTextMaxFPS; 587 this->geTextMaxFPS = NULL; 588 delete this->geTextMinFPS; 589 this->geTextMinFPS = NULL; 590 } 591 this->bDisplayFPS = display; 592 #else 593 this->bDisplayFPS = false; 585 594 #endif /* NO_TEXT */ 586 } 587 this->bDisplayFPS = display; 588 } 589 590 591 /** 592 \brief processes the events for the GraphicsEngine class 595 } 596 597 598 /** 599 processes the events for the GraphicsEngine class 593 600 * @param the event to handle 594 601 */ … … 603 610 604 611 } 605 -
trunk/src/lib/graphics/graphics_engine.h
r5261 r5346 83 83 84 84 public: 85 static bool texturesEnabled; //!< if textures should be enabled (globally)85 static bool texturesEnabled; //!< if textures should be enabled (globally) 86 86 87 87 88 88 private: 89 static GraphicsEngine* singletonRef; //!< Pointer to the only instance of this Class90 bool isInit; //!< if the GraphicsEngine is initialized.89 static GraphicsEngine* singletonRef; //!< Pointer to the only instance of this Class 90 bool isInit; //!< if the GraphicsEngine is initialized. 91 91 92 SDL_Surface* screen; //!< the screen we draw to 93 int resolutionX; //!< the X-resoultion of the screen 94 int resolutionY; //!< the Y-resolution of the screen 95 int bitsPerPixel; //!< the bits per pixels of the screen 96 Uint32 fullscreenFlag; //!< if we are in fullscreen mode 97 Uint32 videoFlags; //!< flags for video 98 SDL_Rect** videoModes; //!< list of resolutions 92 // state. 93 SDL_Surface* screen; //!< the screen we draw to 94 int resolutionX; //!< the X-resoultion of the screen 95 int resolutionY; //!< the Y-resolution of the screen 96 int bitsPerPixel; //!< the bits per pixels of the screen 97 Uint32 fullscreenFlag; //!< if we are in fullscreen mode 98 Uint32 videoFlags; //!< flags for video 99 SDL_Rect** videoModes; //!< list of resolutions 99 100 100 bool bDisplayFPS; //!< is true if the fps should be displayed 101 float currentFPS; //!< the current frame rate: frames per seconds 102 float maxFPS; //!< maximal frame rate we ever got since start of the game 103 float minFPS; //!< minimal frame rate we ever got since start 101 bool fogEnabled; //!< If Fog should be enabled. 102 bool shadowsEnabled; //!< If Shadows should be enabled. 103 bool particlesEnabled; //!< If particles should be enabled. 104 int particlesValue; //!< How many particles 105 int textureQuality; //!< the quality of Textures 106 int filteringMethod; //!< The filtering Method of textures. 107 int modelQuality; //!< The quality of the Models loaded. 108 int antialiasingDepth; //!< the Depth of the AntiAlias-Filter. 104 109 105 110 // HARDWARE-Settings: 106 char* hwRenderer; 107 char* hwVendor; 108 char* hwVersion; 109 SubString* hwExtensions; 111 char* hwRenderer; //!< HW-renderer-string 112 char* hwVendor; //!< HW-vendor-string 113 char* hwVersion; //!< HW-version-string 114 SubString* hwExtensions; //!< All suported Extensions. 115 116 // FPS-related 117 bool bDisplayFPS; //!< is true if the fps should be displayed 118 float currentFPS; //!< the current frame rate: frames per seconds 119 float maxFPS; //!< maximal frame rate we ever got since start of the game 120 float minFPS; //!< minimal frame rate we ever got since start. 110 121 111 122 #ifndef NO_TEXT 112 Text* geTextCFPS; //!< Text for the current FPS113 Text* geTextMaxFPS; //!< Text for the max FPS114 Text* geTextMinFPS; //!< Text for the min FPS123 Text* geTextCFPS; //!< Text for the current FPS 124 Text* geTextMaxFPS; //!< Text for the max FPS 125 Text* geTextMinFPS; //!< Text for the min FPS 115 126 #endif /* NO_TEXT */ 116 127 };
Note: See TracChangeset
for help on using the changeset viewer.