Support of IsKeyPressed that only trigger for the frame it is pressed on.
This commit is contained in:
+1
-12
@@ -225,20 +225,9 @@ void JulietApplication::Shutdown()
|
||||
Log(LogLevel::Message, LogCategory::Tool, "Juliet App shutdown Completed");
|
||||
}
|
||||
|
||||
void JulietApplication::Update()
|
||||
void JulietApplication::Update(float deltaTime)
|
||||
{
|
||||
static LARGE_INTEGER frequency = {};
|
||||
static LARGE_INTEGER lastTime = {};
|
||||
if (frequency.QuadPart == 0)
|
||||
{
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
QueryPerformanceCounter(&lastTime);
|
||||
}
|
||||
|
||||
LARGE_INTEGER currentTime;
|
||||
QueryPerformanceCounter(¤tTime);
|
||||
float deltaTime = static_cast<float>(currentTime.QuadPart - lastTime.QuadPart) / static_cast<float>(frequency.QuadPart);
|
||||
lastTime = currentTime;
|
||||
|
||||
CameraTime += deltaTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user