Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2105 in orxonox.OLD for orxonox/branches/chris/src/orxonox.cc


Ignore:
Timestamp:
Jul 11, 2004, 3:14:52 PM (21 years ago)
Author:
chris
Message:

orxonox/branches/chris: Port to SDL complete. Everything compiles and the generated executable runs without crashing. Keyboard and mouse handling works. Drawing is messed up, possibly because of my incompetent Rotation class. Hence all you see at them moment is a pitch black screen. I added the makefile I used to compile it since bensch hasn't yet included SDL into the configure script.

File:
1 edited

Legend:

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

    r2104 r2105  
    7272        strcat (configfilename, "/.orxonox.conf");*/
    7373       
    74         strcpy (configfilename, "./orxonox.conf");
     74        strcpy (configfilename, "orxonox.conf");
    7575}
    7676
     
    119119  int width = 640;
    120120  int height = 480;
    121   Uint32 flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
     121  Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
    122122 
    123123  if( (screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
     
    187187{
    188188        bQuitOrxonox = true;
    189   //cout << "finished garbage colletion, quitting..." << endl;
    190189}
    191190void Orxonox::mainLoop()
    192191{
    193192        lastframe = SDL_GetTicks();
    194 
     193        bQuitOrxonox = false;
    195194  // This is where everything is run
     195printf("Orxonox|Entering main loop\n");
    196196  while( !bQuitOrxonox)
    197197  {
     
    207207    display();
    208208  }
     209printf("Orxonox|Exiting the main loop\n");
    209210}
    210211
     
    244245}
    245246
     247bool Orxonox::system_command (Command* cmd)
     248{
     249        if( !strcmp( cmd->cmd, "quit") && !cmd->bUp)
     250        {
     251                bQuitOrxonox = true;
     252                return true;
     253        }
     254}
     255
    246256void Orxonox::display ()
    247257{
     
    254264                // draw HUD
    255265                // flip buffers
    256         SDL_Flip( screen);
     266        SDL_GL_SwapBuffers();
    257267}
    258268
     
    274284int main (int argc, char** argv)
    275285
     286        printf(">>> Starting Orxonox <<<\n");
    276287  Orxonox *orx = Orxonox::getInstance();
    277288 
Note: See TracChangeset for help on using the changeset viewer.