Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3619 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Mar 21, 2005, 4:33:03 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: added a Function to resize the Window, but it does not work :( GL does not update with SDL together

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3617 r3619  
    7272
    7373  // setting the Video Flags.
    74   this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
     74  this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE | SDL_DOUBLEBUF;
    7575
    7676  /* query SDL for information about our video hardware */
     
    8686    this->videoFlags |= SDL_SWSURFACE;
    8787  /*
    88   if(VideoInfo -> blit_hw)                           
     88  if(VideoInfo -> blit_hw)
    8989    VideoFlags |= SDL_HWACCEL;
    9090  */
    9191
    9292  // setting up the Resolution
    93   this->setResoulution(800, 600, 16);
     93  this->setResolution(800, 600, 16);
    9494 
    9595  // Set window labeling
     
    121121}
    122122
    123 int GraphicsEngine::setResoulution(int width, int height, int bpp)
     123int GraphicsEngine::setResolution(int width, int height, int bpp)
    124124{
    125125  this->resolutionX = width;
     
    127127  this->bitsPerPixel = bpp;
    128128 
     129  printf ("ok\n");
    129130  if((this->screen = SDL_SetVideoMode (this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
    130131    {
     
    136137}
    137138
     139int GraphicsEngine::resolutionChanged(SDL_ResizeEvent* resizeInfo)
     140{
     141  this->setResolution(resizeInfo->w, resizeInfo->h, this->bitsPerPixel);
     142}
    138143
    139144
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r3617 r3619  
    2525  int initVideo();
    2626  int setGLattribs(void);
    27   int setResoulution(int width, int height, int bpp);
     27  int setResolution(int width, int height, int bpp);
     28  int resolutionChanged(SDL_ResizeEvent* resizeInfo);
    2829  void listModes(void);
    2930
  • orxonox/trunk/src/orxonox.cc

    r3613 r3619  
    213213{
    214214  // Handle special events such as reshape, quit, focus changes
     215  switch (event->type)
     216    {
     217    case SDL_VIDEORESIZE:
     218      GraphicsEngine* tmpGEngine = GraphicsEngine::getInstance();
     219      tmpGEngine->resolutionChanged(&event->resize);
     220      break;
     221    }
    215222}
    216223 
Note: See TracChangeset for help on using the changeset viewer.