summaryrefslogtreecommitdiffstats
path: root/Imgui/src
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-01 16:41:56 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-01 16:41:56 +0000
commit2c3adc4f5d7150c466efbca88a0a45917af47a74 (patch)
tree403937f6ce839e5b294c89153290a3a46f292239 /Imgui/src
parentImGui: enabled touch event handling on iOS (diff)
downloadDiligentTools-2c3adc4f5d7150c466efbca88a0a45917af47a74.tar.gz
DiligentTools-2c3adc4f5d7150c466efbca88a0a45917af47a74.zip
ImGuiImplIOS: implemented time handling
Diffstat (limited to 'Imgui/src')
-rw-r--r--Imgui/src/ImGuiImplIOS.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/Imgui/src/ImGuiImplIOS.mm b/Imgui/src/ImGuiImplIOS.mm
index 9ad4463..60b7dbf 100644
--- a/Imgui/src/ImGuiImplIOS.mm
+++ b/Imgui/src/ImGuiImplIOS.mm
@@ -23,6 +23,7 @@
#include "imgui.h"
#include "ImGuiImplIOS.h"
+#import <CoreFoundation/CoreFoundation.h>
namespace Diligent
{
@@ -39,6 +40,7 @@ ImGuiImplIOS::ImGuiImplIOS(IRenderDevice* pDevice,
ImGuiIO& io = ImGui::GetIO();
//io.FontGlobalScale = 2;
io.DisplaySize = ImVec2(DisplayWidth, DisplayHeight);
+ io.BackendPlatformName = "ImGuiImplIOS";
}
ImGuiImplIOS::~ImGuiImplIOS()
@@ -48,6 +50,13 @@ ImGuiImplIOS::~ImGuiImplIOS()
void ImGuiImplIOS::NewFrame()
{
std::lock_guard<std::mutex> Lock(m_Mtx);
+ if (m_Time == 0.0)
+ m_Time = CFAbsoluteTimeGetCurrent();
+ CFAbsoluteTime current_time = CFAbsoluteTimeGetCurrent();
+ ImGuiIO& io = ImGui::GetIO();
+ io.DeltaTime = current_time - m_Time;
+ m_Time = current_time;
+
ImGuiImplDiligent::NewFrame();
}