Changeset 4784 in orxonox.OLD for orxonox/trunk/src/lib/graphics/graphics_engine.cc
- Timestamp:
- Jul 3, 2005, 4:49:42 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4782 r4784 36 36 this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine"); 37 37 this->setName("GraphicsEngine"); 38 39 this->isInit = false; 40 38 41 this->bDisplayFPS = false; 39 42 this->minFPS = 9999; … … 42 45 this->fullscreenFlag = 0; 43 46 44 this->initVideo(); 45 46 this->listModes(); 47 // this->listModes(); 47 48 } 48 49 … … 60 61 } 61 62 63 int GraphicsEngine::init() 64 { 65 this->initVideo(640,480,16); 66 } 67 62 68 /** 63 69 \brief initializes the Video for openGL. … … 65 71 This has to be done only once when starting orxonox. 66 72 */ 67 int GraphicsEngine::initVideo() 68 { 73 int GraphicsEngine::initVideo(unsigned int resX, unsigned int resY, unsigned int bbp) 74 { 75 if (this->isInit) 76 return -1; 69 77 // initialize SDL_VIDEO 70 78 if (SDL_Init(SDL_INIT_VIDEO) == -1) … … 95 103 */ 96 104 // setting up the Resolution 97 this->setResolution( 640, 480, 16);105 this->setResolution(resX, resY, bbp); 98 106 99 107 // TO DO: Create a cool icon and use it here … … 104 112 // Enable default GL stuff 105 113 glEnable(GL_DEPTH_TEST); 114 115 this->isInit = true; 106 116 } 107 117 … … 112 122 * @returns nothing usefull 113 123 */ 114 int GraphicsEngine:: loadFromIniFile(IniParser* iniParser)124 int GraphicsEngine::initFromIniFile(IniParser* iniParser) 115 125 { 116 126 // searching for a usefull resolution 117 127 SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x'); 118 this-> setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);128 this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 119 129 120 130 // looking if we are in fullscreen-mode
Note: See TracChangeset
for help on using the changeset viewer.