Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2005, 4:49:42 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setting the resolution works again (workaround. now i fix the subprojects again.)

File:
1 edited

Legend:

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

    r4782 r4784  
    3636  this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine");
    3737  this->setName("GraphicsEngine");
     38
     39  this->isInit = false;
     40
    3841  this->bDisplayFPS = false;
    3942  this->minFPS = 9999;
     
    4245  this->fullscreenFlag = 0;
    4346
    44   this->initVideo();
    45 
    46   this->listModes();
     47//  this->listModes();
    4748}
    4849
     
    6061}
    6162
     63int GraphicsEngine::init()
     64{
     65  this->initVideo(640,480,16);
     66}
     67
    6268/**
    6369   \brief initializes the Video for openGL.
     
    6571   This has to be done only once when starting orxonox.
    6672*/
    67 int GraphicsEngine::initVideo()
    68 {
     73int GraphicsEngine::initVideo(unsigned int resX, unsigned int resY, unsigned int bbp)
     74{
     75  if (this->isInit)
     76    return -1;
    6977  // initialize SDL_VIDEO
    7078  if (SDL_Init(SDL_INIT_VIDEO) == -1)
     
    95103  */
    96104    // setting up the Resolution
    97   this->setResolution(640, 480, 16);
     105  this->setResolution(resX, resY, bbp);
    98106
    99107  // TO DO: Create a cool icon and use it here
     
    104112  // Enable default GL stuff
    105113  glEnable(GL_DEPTH_TEST);
     114
     115  this->isInit = true;
    106116}
    107117
     
    112122 * @returns nothing usefull
    113123 */
    114 int GraphicsEngine::loadFromIniFile(IniParser* iniParser)
     124int GraphicsEngine::initFromIniFile(IniParser* iniParser)
    115125{
    116126  // searching for a usefull resolution
    117127  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);
    119129
    120130  // looking if we are in fullscreen-mode
Note: See TracChangeset for help on using the changeset viewer.