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.

  1. int EntryInterface::run()

  2. {

  3.   // base init

  4.   window.open();

  5.   window.callback(this);

  6.   renderer.callback(this);


  7.   if (!renderer.init(&window))

  8.    return 1; // we failed

  9.   // end


  10.   // callback

  11.   onPostInit(&renderer);


  12.   // start

  13.   while (is_running)

  14.   {

  15.    if (timer.accumulate(update_rate))

  16.    {

  17.     window.update();

  18.     update(&window);

  19.    }


  20.    render(&renderer, timer.accumulateDelta());

  21.    renderer.present();


  22.    ++sample_frames;

  23.    if (fps_timer.accumulate(1.0f))

  24.    {

  25.     // a second has passed

  26.     fps = sample_frames;


  27.     sample_frames = 0;


  28.     log("Fps: ", fps);

  29.    }

  30.   }


  31.   return 0;

  32. }

  • Comments (0)
  • Posted: 2009-09-03

to be implemented..

devmoon.se © 2009
(Solo Game Programming)