aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/QuickMedia.hpp1
-rw-r--r--include/Vsync.hpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp
index 27863cc..faee324 100644
--- a/include/QuickMedia.hpp
+++ b/include/QuickMedia.hpp
@@ -65,6 +65,7 @@ namespace QuickMedia {
private:
Display *disp;
sf::RenderWindow window;
+ int monitor_hz;
sf::Vector2f window_size;
sf::Font font;
sf::Font bold_font;
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