Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3336 in orxonox.OLD for orxonox


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

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

Location:
orxonox/branches/parenting/src
Files:
5 edited

Legend:

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

    r3231 r3336  
    8989  while( se != NULL && this->running)
    9090    {
    91       se->displayLoadScreen();
     91      //se->displayLoadScreen();
    9292      se->load();
    9393      se->init();
    94       se->releaseLoadScreen();
     94      //se->releaseLoadScreen();
    9595      se->start();
    9696      se->destroy();
  • orxonox/branches/parenting/src/environment.cc

    r3309 r3336  
    2929Environment::Environment () : WorldEntity()
    3030{
    31   //this->model = new Object("reaplow.obj");
     31  this->model = new Object("reaplow.obj");
    3232}
    3333
     
    3636Environment::~Environment ()
    3737{
    38   //delete this->model;
     38  delete this->model;
    3939}
    4040
     
    5959 
    6060  glMatrixMode(GL_MODELVIEW);
    61   // this->model->draw();
     61  this->model->draw();
    6262}
    6363
  • 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
  • orxonox/branches/parenting/src/orxonox.h

    r3226 r3336  
    6868  Camera* getCamera();
    6969  World* getWorld();
     70  SDL_Surface* getScreen ();
    7071 
    7172  //void mainLoop();
  • orxonox/branches/parenting/src/world.h

    r3335 r3336  
    4949  void unload ();
    5050  bool command (Command* cmd);
     51  virtual void displayLoadScreen();
     52  virtual void releaseLoadScreen();
    5153 
    5254  void setTrackLen (Uint32 tracklen);
     
    7880  int debugWorldNr;
    7981  GLuint objectList;
     82  SDL_Surface *loadImage;
    8083
    8184  WorldEntity* localPlayer;
Note: See TracChangeset for help on using the changeset viewer.