Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. void EngineInit()
  2. {
  3.        _running = true;
  4.  
  5.         _frameSectionID = iStatistics::getInstance().registerSection("app:frame", 0);
  6.         _handleSectionID = iStatistics::getInstance().registerSection("app:handle", 0);
  7.  
  8.  }
  9.  
  10. void EngineDoYourStuff()
  11. {
  12.             iStatistics::getInstance().nextFrame();
  13.  
  14.             iStatistics::getInstance().beginSection(_frameSectionID);
  15.             iTimer::getInstance().handle();
  16.  
  17.             _windows.flush();
  18.            
  19.             iNodeFactory::getInstance().handle();
  20.             iPhysics::getInstance().handle();
  21.  
  22.             iStatistics::getInstance().beginSection(_handleSectionID);
  23.             handle();
  24.             iStatistics::getInstance().endSection(_handleSectionID);
  25.  
  26.             draw();
  27.  
  28.             iStatistics::getInstance().endSection(_frameSectionID);
  29. }
  30.  
  31. void EngineDestroy()
  32. {
  33.         iStatistics::getInstance().unregisterSection(_frameSectionID);
  34.         iStatistics::getInstance().unregisterSection(_handleSectionID);
  35. }
  36.  
  37.  
  38.  
  39. // this is written by the user:
  40.  
  41. void UserCodeDoYourStuff()
  42. {
  43.     // whatever
  44. }
  45.  
  46. void iApplication::run()
  47.     {
  48.         EngineIniT();
  49.         do
  50.         {
  51.             EngineDoYourStuff();
  52.             UserCodeDoYourStuff();
  53.         } while (_running);
  54.         EngineDestroy(); 
  55.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement