add D3D11 project
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#include "Time.h"
|
||||
#include <string>
|
||||
|
||||
UINT Time::init()
|
||||
{
|
||||
_lastTime = CLOCK::now();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Time::update()
|
||||
{
|
||||
TIME_POINT now = CLOCK::now();
|
||||
SECONDS diff = now - _lastTime;
|
||||
_deltaTime = diff.count();
|
||||
_lastTime = now;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifdef UNICODE
|
||||
wstring output = L"fps: " + to_wstring(1 / _deltaTime) + L"\n";
|
||||
OutputDebugString(output.c_str());
|
||||
#else // !UNICODE
|
||||
string output = "fps: " + to_string(1 / _deltaTime) + "\n";
|
||||
OutputDebugString(output.c_str());
|
||||
#endif // UNICODE
|
||||
|
||||
|
||||
#endif // DEBUG
|
||||
|
||||
}
|
||||
|
||||
void Time::deInit()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user