summaryrefslogtreecommitdiff
path: root/src/main_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_windows.cpp')
-rw-r--r--src/main_windows.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main_windows.cpp b/src/main_windows.cpp
index 61f9876..f657042 100644
--- a/src/main_windows.cpp
+++ b/src/main_windows.cpp
@@ -33,6 +33,7 @@ static HGLRC g_hRC;
static WGL_WindowData g_MainWindow;
static int g_Width;
static int g_Height;
+LARGE_INTEGER Frequency;
bool CreateDeviceWGL(HWND hWnd, WGL_WindowData* data);
void CleanupDeviceWGL(HWND hWnd, WGL_WindowData* data);
@@ -50,6 +51,16 @@ static const char* _ts_platform_get_config_file_path(char* buffer) {
return 0;
}
+uint64_t ts_platform_get_time(uint64_t compare)
+{
+ LARGE_INTEGER stamp;
+ QueryPerformanceCounter(&stamp);
+ if (compare != 0) {
+ return (stamp.QuadPart - compare) * 1000 / Frequency.QuadPart;
+ }
+ return stamp.QuadPart;
+}
+
int main(int, char**)
{
// Create application window
@@ -92,6 +103,8 @@ int main(int, char**)
ImGui_ImplWin32_InitForOpenGL(hwnd);
ImGui_ImplOpenGL3_Init();
+ QueryPerformanceFrequency(&Frequency);
+
ts_init();
ts_load_images();