Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1897 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 20, 2004, 1:35:53 AM (21 years ago)
Author:
patrick
Message:

orxonox/trunk: now displaying fps in console. my old computer gets 40fps :)

Location:
orxonox/trunk/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/core/orxonox.cc

    r1896 r1897  
    5656bool Orxonox::leftWeGo = false;
    5757bool Orxonox::shoot1 = false;
     58int Orxonox::fps = 0;
    5859int Orxonox::alpha = 0;
    5960int Orxonox::beta = 0;
     
    8485  glutKeyboardFunc(keyboard);
    8586  glutKeyboardUpFunc(upKeyboard);
     87
     88  glutTimerFunc(1000, timeSlice, 0);
    8689}
    8790
     
    110113  //cout << "Orxonox::gameInit" << endl;
    111114}
     115
     116
     117/* this is the time triggered function. heart beat*/
     118
     119void Orxonox::timeSlice(int value)
     120{
     121  cout << "fps: " << fps << endl;
     122  fps = 0;
     123  glutTimerFunc(1000, timeSlice, 0);
     124}
     125
    112126
    113127
     
    232246void Orxonox::continousRedraw()
    233247{
     248  /* increment the frames-per-second counter*/
     249  fps++;
    234250  /* check for input to pass it over */
    235251  if ( !pause && (rightWeGo || leftWeGo || upWeGo || downWeGo || shoot1)) {
  • orxonox/trunk/core/orxonox.h

    r1896 r1897  
    3636  static bool leftWeGo;
    3737  static bool shoot1;
     38  static int fps;
    3839
    3940  static int alpha;
     
    4142  static int offsetX;
    4243  static int offsetY;
     44
     45  static void timeSlice(int value);
    4346
    4447 public:
Note: See TracChangeset for help on using the changeset viewer.