Original Post
I am making a game engine. I decided I want to use Boost for stuff like networking and memory management, OpenGL and DirectX 10 for graphics with a graphics layer, OpenAL for audio, GLFW for window and input handling, and to do the rest of the stuff, like physics myself. I may decide to use a physics engine later, if it turns out to take too much time to do everything else. Do you think this is a good choice of tools to use, and more importantly, do you think Boost would work as good memory management, with Boost::Pool or something? Also, I made a timer class for my game engine. I used the C++ time class to do it, as seen here: http://www.cplusplus.com/reference/clibrary/ctime/time.html. This is my class:
#include "../include/CTimer.h"
CTimer::CTimer() {
sTime = time (NULL);
}
void CTimer::tick() {
lTime = time;
time = time (NULL);
delta = time - lTime;
rTime = time - sTime;
}
double CTimer::getTime() {
return delta;
}
double CTimer::getTotalTime() {
return rTime;
}
void CTimer::setTime(double newTime) {
time = (time_t)newTime;
}
CTimer::~CTimer() {
} And my include file: #ifndef CTIMER_H_INCLUDED
#define CTIMER_H_INCLUDED
#include <time.h>
#include <stdio.h>
class CTimer {
protected:
time_t sTime;
time_t delta;
time_t time;
time_t lTime;
time_t rTime;
public:
CTimer();
~CTimer();
double getTime();
double getTotalTime();
void setTime(double time);
void tick();
};
#endif // CTIMER_H_INCLUDED
And the error might help: C:\Projects\Orange3d\Orange3D\System\CTimer.cpp||In constructor `CTimer::CTimer()':|
C:\Projects\Orange3d\Orange3D\System\CTimer.cpp|4|error: `((CTimer*)this)->CTimer::time' cannot be used as a function|
C:\Projects\Orange3d\Orange3D\System\CTimer.cpp||In member function `void CTimer::tick()':|
C:\Projects\Orange3d\Orange3D\System\CTimer.cpp|8|error: `((CTimer*)this)->CTimer::time' cannot be used as a function|
||=== Build finished: 2 errors, 0 warnings ===|
I appreciate anyone and everyone's help.