42 lines
687 B
C++
42 lines
687 B
C++
|
|
#include "engine.h"
|
|
|
|
#include "scenemanager.h"
|
|
|
|
//#include "bullet/btBulletCollisionCommon.h"
|
|
//#include "bullet/btBulletDynamicsCommon.h"
|
|
|
|
Engine::Engine(Input* input): m_input(input)
|
|
{
|
|
m_clock.restart();
|
|
}
|
|
|
|
void Engine::update()
|
|
{
|
|
//update time variable
|
|
m_lastTimeStamp = m_timeStamp;
|
|
m_timeStamp = (unsigned int) m_clock.getElapsedTime().asMilliseconds();
|
|
//update Events
|
|
m_input->updateEvents();
|
|
}
|
|
|
|
void Engine::render()
|
|
{
|
|
// work for SparrowRenderer
|
|
}
|
|
|
|
void Engine::updatePhysics()
|
|
{
|
|
// work for Bullet
|
|
}
|
|
|
|
unsigned int Engine::getTime()
|
|
{
|
|
return m_timeStamp;
|
|
}
|
|
|
|
unsigned int Engine::getDeltaTime()
|
|
{
|
|
return m_timeStamp - m_lastTimeStamp;
|
|
}
|