Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2005, 11:27:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/movie_player: merged the trunk back into the movie_player
merged with command:
svn merge -r 4014:HEAD ../trunk/ movie_player/
no conflicts

File:
1 edited

Legend:

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

    r3844 r4217  
    1717
    1818#include "graphics_engine.h"
     19#include "resource_manager.h"
    1920
    2021#include "debug.h"
     
    3031{
    3132  this->setClassName ("GraphicsEngine");
     33
     34  this->fullscreen = false;
     35
    3236  this->initVideo();
    3337
     
    101105 
    102106  // TO DO: Create a cool icon and use it here
    103   SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 
    104 
     107  char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100];
     108  sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(),  "pictures/orxonox-icon32x32.bmp");
     109  SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 
     110  delete loadPic;
    105111  // Enable default GL stuff
    106112  glEnable(GL_DEPTH_TEST);
     
    137143int GraphicsEngine::setResolution(int width, int height, int bpp)
    138144{
     145  Uint32 fullscreenFlag;
    139146  this->resolutionX = width;
    140147  this->resolutionY = height;
    141148  this->bitsPerPixel = bpp;
     149  if (this->fullscreen)
     150    fullscreenFlag = SDL_FULLSCREEN;
     151  else
     152    fullscreenFlag = 0;
    142153 
    143154  printf ("ok\n");
    144   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
     155  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL)
    145156    {
    146157      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
     
    148159      //    return -1;
    149160    }
    150 
     161}
     162
     163void GraphicsEngine::setFullscreen(bool fullscreen)
     164{
     165  this->fullscreen = fullscreen;
     166  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
    151167}
    152168
     
    254270  /* Check if our resolution is restricted */
    255271  if(this->videoModes == (SDL_Rect **)-1){
    256     PRINTF(1)("All resolutions available.\n");
     272    PRINTF(2)("All resolutions available.\n");
    257273  }
    258274  else{
     
    260276    PRINT(0)("Available Resoulution Modes are\n");
    261277    for(int i = 0; this->videoModes[i]; ++i)
    262       PRINT(0)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
     278      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
    263279  }
    264280 
Note: See TracChangeset for help on using the changeset viewer.