Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4768 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jul 2, 2005, 12:03:12 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ini-parser small cleanup char* → const char*

Location:
orxonox/trunk/src/lib/graphics
Files:
2 edited

Legend:

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

    r4766 r4768  
    3737  this->maxFPS = 0;
    3838
    39   this->fullscreen = false;
     39  this->fullscreenFlag = 0;
    4040
    4141  this->initVideo();
     
    9292  */
    9393    // setting up the Resolution
    94   this->setResolution(550, 400, 16);
     94  this->setResolution(640, 480, 16);
    9595
    9696  // TO DO: Create a cool icon and use it here
     
    146146int GraphicsEngine::setResolution(int width, int height, int bpp)
    147147{
    148   Uint32 fullscreenFlag;
    149148  this->resolutionX = width;
    150149  this->resolutionY = height;
    151150  this->bitsPerPixel = bpp;
    152151
    153   if (this->fullscreen)
     152  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | SDL_FULLSCREEN)) == NULL)
     153    {
     154      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
     155      SDL_Quit();
     156      //    return -1;
     157    }
     158}
     159
     160/**
     161   \brief sets Fullscreen mode
     162   \param fullscreen true if fullscreen, false if windowed
     163*/
     164void GraphicsEngine::setFullscreen(bool fullscreen)
     165{
     166  if (fullscreen)
    154167    fullscreenFlag = SDL_FULLSCREEN;
    155168  else
    156169    fullscreenFlag = 0;
    157 
    158   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL)
    159     {
    160       PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
    161       SDL_Quit();
    162       //    return -1;
    163     }
    164 }
    165 
    166 /**
    167    \brief sets Fullscreen mode
    168    \param fullscreen true if fullscreen, false if windowed
    169 */
    170 void GraphicsEngine::setFullscreen(bool fullscreen)
    171 {
    172   this->fullscreen = fullscreen;
    173170  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
    174171}
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4746 r4768  
    7575    int            resolutionY;     //!< the Y-resolution of the screen
    7676    int            bitsPerPixel;    //!< the bits per pixels of the screen
    77     bool           fullscreen;      //!< if we are in fullscreen mode
     77    Uint32         fullscreenFlag;  //!< if we are in fullscreen mode
    7878    Uint32         videoFlags;      //!< flags for video
    7979    SDL_Rect**     videoModes;      //!< list of resolutions
Note: See TracChangeset for help on using the changeset viewer.