From 82234b4454299e0472344d5cf71bd8f70586133e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 15 Oct 2021 03:42:45 +0200 Subject: Remove dependency on xrdb for Xft.dpi --- src/Utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Utils.cpp') diff --git a/src/Utils.cpp b/src/Utils.cpp index 3e9fe7d..d466bee 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -78,6 +78,13 @@ namespace QuickMedia { return time_str; } + int64_t get_boottime_milliseconds() { + struct timespec time; + if(clock_gettime(CLOCK_BOOTTIME, &time) == -1 && errno == EINVAL) + clock_gettime(CLOCK_MONOTONIC, &time); + return (int64_t)time.tv_sec * 1000 + (int64_t)time.tv_nsec / 1000000; + } + sf::Vector2f vec2f_floor(float x, float y) { return sf::Vector2f(int(x), int(y)); } -- cgit v1.2.3