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;
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ class JulietApplication : public Juliet::IApplication
|
||||
protected:
|
||||
void Init(Juliet::NonNullPtr<Juliet::Arena> arena) override;
|
||||
void Shutdown() override;
|
||||
void Update() override;
|
||||
void Update(float deltaTime) override;
|
||||
bool IsRunning() override;
|
||||
|
||||
Juliet::Window* GetPlatformWindow() override { return MainWindow; }
|
||||
|
||||
Reference in New Issue
Block a user