This is the core of the rendering & update processing of the 3D engine.
This code parser lacks very many features and currently have problems with for example the indentation and i will fix them as soon as i can when i get the time for it.
int EntryInterface::run()
{
  // base init
  window.open();
  window.callback(this);
  renderer.callback(this);
  if (!renderer.init(&window))
   return 1; // we failed
  // end
  // callback
  onPostInit(&renderer);
  // start
  while (is_running)
  {
   if (timer.accumulate(update_rate))
   {
    window.update();
    update(&window);
   }
   render(&renderer, timer.accumulateDelta());
   renderer.present();
   ++sample_frames;
   if (fps_timer.accumulate(1.0f))
   {
    // a second has passed
    fps = sample_frames;
    sample_frames = 0;
    log("Fps: ", fps);
   }
  }
  return 0;
}
- Comments (0)
- Posted: 2009-09-03