aboutsummaryrefslogtreecommitdiff
path: root/include/Vsync.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-14 04:45:54 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-14 04:45:54 +0200
commitaf01062b0a207c106a6ebb599993fb72a43484c5 (patch)
treef081c78e9684af0bd3cef9d13a1aa9e5e2733770 /include/Vsync.hpp
parentf0122e7386e0e4fe63dafa9c1835ae0b04557ee4 (diff)
Use manual vsync since nouveau drivers are broken
Diffstat (limited to 'include/Vsync.hpp')
-rw-r--r--include/Vsync.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/Vsync.hpp b/include/Vsync.hpp
new file mode 100644
index 0000000..387d2b5
--- /dev/null
+++ b/include/Vsync.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <SFML/Graphics/RenderWindow.hpp>
+
+namespace QuickMedia {
+ class VSync {
+ public:
+ VSync(int framerate);
+ void display(sf::RenderWindow &window);
+ private:
+ sf::Int64 target_frame_delta_micro;
+ sf::Int64 overflow;
+ sf::Clock timer;
+ };
+} \ No newline at end of file