diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-09-13 21:01:53 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-09-13 21:01:53 +0700 |
| commit | 63f402e1bc8b9bf790a890d6b3ab86c7a9e61a44 (patch) | |
| tree | 6ab0044d52ad5a63d3a0dfb845788172d31cdd34 /src | |
| parent | 3e961919c2582c258529c3f0a3bba8f85239061d (diff) | |
| download | gfz-63f402e1bc8b9bf790a890d6b3ab86c7a9e61a44.tar.gz | |
Wrap swap interval function
Diffstat (limited to 'src')
| -rw-r--r-- | src/Window.zig | 1 | ||||
| -rw-r--r-- | src/gfz.zig | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/Window.zig b/src/Window.zig index eba375c..4f22fa9 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -185,6 +185,7 @@ pub fn setShouldClose(self: Window, value: bool) Error!void { try checkError(); } +/// Swap the front and back buffers. pub fn swapBuffers(self: Window) Error!void { glfwSwapBuffers(self.pimpl); try checkError(); diff --git a/src/gfz.zig b/src/gfz.zig index 46bd247..d96f197 100644 --- a/src/gfz.zig +++ b/src/gfz.zig @@ -98,6 +98,12 @@ pub fn deinit() Error!void { try checkError(); } +/// Set the swap interval for the current context. +pub fn swapInterval(interval: c_int) Error!void { + glfwSwapInterval(interval); + try checkError(); +} + /// Process all pending events. pub fn pollEvents() Error!void { glfwPollEvents(); |
