Expression have must class type
Ostatnio zmodyfikowano 2012-08-17 09:15
yoogi Temat założony przez niniejszego użytkownika |
Expression have must class type » 2012-08-17 09:15:23 #ifndef FramePerSecond_h #define FramePerSecond_h
#include <time.h>
class FramePerSecond { public: FramePerSecond(); void Add(); int GetIntValue(); private: clock_t starttime; int fpsValue; int temp; };
#endif
#include "FramePerSecond.h"
FramePerSecond::FramePerSecond() { starttime = clock() + 1.00 * CLOCKS_PER_SEC; fpsValue = 0; temp = 0; }
void FramePerSecond::Add() { if( clock() < starttime ) temp++; else { fpsValue = temp; temp = 0; starttime = clock() + 1.00 * CLOCKS_PER_SEC; } }
int FramePerSecond::GetIntValue() { return fpsValue; }
Help! :) #edit durny błąd, zamiast FramePerSecond fps; pisałem FramePerSecond fps(); |
|
« 1 » |