Changeset 2551 in orxonox.OLD for orxonox/trunk/src/orxonox.cc
- Timestamp:
- Oct 11, 2004, 12:53:43 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r2190 r2551 230 230 void Orxonox::mainLoop() 231 231 { 232 233 232 lastframe = SDL_GetTicks(); 233 bQuitOrxonox = false; 234 234 // This is where everything is run 235 printf("Orxonox|Entering main loop\n");235 printf("Orxonox|Entering main loop\n"); 236 236 while( !bQuitOrxonox) 237 { 238 // Network 239 synchronize(); 240 // Process input 241 handle_input(); 242 // Process time 243 time_slice(); 244 // Process collision 245 collision(); 246 // Draw 247 display(); 248 } 249 printf("Orxonox|Exiting the main loop\n"); 237 { 238 printf("<=="); 239 240 // Network 241 synchronize(); 242 // Process input 243 handle_input(); 244 // Process time 245 time_slice(); 246 // Process collision 247 collision(); 248 // Draw 249 display(); 250 251 printf(">\n"); 252 } 253 printf("Orxonox|Exiting the main loop\n"); 250 254 } 251 255 … … 283 287 void Orxonox::time_slice () 284 288 { 285 Uint32 curframe = SDL_GetTicks(); 286 if( !pause) 289 Uint32 curframe = SDL_GetTicks(); 290 if( !pause) 291 { 292 Uint32 dt = curframe - lastframe; 293 294 if(dt > 0) 287 295 { 288 world->time_slice (curframe - lastframe); 289 world->update (); 290 localcamera->time_slice (curframe - lastframe); 296 float fps = 1000/dt; 297 printf("%f", fps); 291 298 } 292 lastframe = curframe; 299 300 world->time_slice (dt); 301 world->update (); 302 localcamera->time_slice (dt); 303 } 304 lastframe = curframe; 293 305 } 294 306
Note: See TracChangeset
for help on using the changeset viewer.