summary refs log tree commit diff
path: root/src/gfz.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gfz.zig')
-rw-r--r--src/gfz.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gfz.zig b/src/gfz.zig
index d96f197..2374ae6 100644
--- a/src/gfz.zig
+++ b/src/gfz.zig
@@ -110,6 +110,18 @@ pub fn pollEvents() Error!void {
     try checkError();
 }
 
+/// Return the GLFW time, in seconds.
+pub fn getTime() Error!f64 {
+    const time = glfwGetTime();
+    return if (time == 0) getError() else time;
+}
+
+/// Set the GLFW time, in seconds.
+pub fn setTime(time: f64) Error!void {
+    glfwSetTime(time);
+    try checkError();
+}
+
 /// Return whether raw mouse motion is supported.
 pub fn rawMouseMotionSupported() Error!bool {
     const result = glfwRawMouseMotionSupported();