Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3336 in orxonox.OLD for orxonox/branches/parenting/src/orxonox.cc


Ignore:
Timestamp:
Jan 5, 2005, 2:05:31 AM (19 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: enhanced graphics initialisation. minor change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/orxonox.cc

    r3226 r3336  
    123123  int width = 640;
    124124  int height = 480;
    125   Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
    126  
    127   if((screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
     125  //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/
     126  //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER;
     127
     128  Uint32 videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
     129
     130  /* query SDL for information about our video hardware */
     131  const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
     132 
     133  if( videoInfo == NULL)
     134    {
     135      printf ("Orxonox::initVideo() - Failed getting Video Info :%s\n", SDL_GetError());
     136      SDL_Quit ();
     137    }
     138  if( videoInfo->hw_available)
     139    videoFlags |= SDL_HWSURFACE;
     140  else
     141    videoFlags |= SDL_SWSURFACE;
     142  /*
     143  if(VideoInfo -> blit_hw)                           
     144    VideoFlags |= SDL_HWACCEL;
     145  */
     146 
     147  if((this->screen = SDL_SetVideoMode (width, height, bpp, videoFlags)) == NULL)
    128148  {
    129     printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
     149    printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, videoFlags, SDL_GetError());
    130150    SDL_Quit();
    131151    return -1;
     
    139159
    140160  // OpenGL stuff
    141   // (Is this all we initialize globally???)
    142161  glClearColor(0.0, 0.0, 0.0, 0.0);
    143162  glEnable(GL_DEPTH_TEST);
     
    311330
    312331
     332SDL_Surface* Orxonox::getScreen ()
     333{
     334  return this->screen;
     335}
    313336
    314337
Note: See TracChangeset for help on using the changeset viewer.