diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Window.zig b/src/Window.zig index 307faf8..919ca9a 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -24,7 +24,8 @@ const getError = gfz.getError; const gfz = @import("gfz.zig"); const Window = @This(); -pimpl: *GLFWwindow, +pub const Impl = GLFWwindow; +pimpl: *Impl, const Options = struct { fullscreen: ?Monitor = null, @@ -42,7 +43,7 @@ fn setHint(hint: c_int, value: anytype) Error!void { } /// Create a window and its associated context. -pub fn create(width: c_int, height: c_int, title: []const u8, +pub fn create(width: c_int, height: c_int, title: [:0]const u8, options: Options, hints: anytype) Error!Window { const Hints = @TypeOf(hints); // TODO: Add all supported GLFW window hints: @@ -125,6 +126,12 @@ pub fn setCursorMode(self: Window, value: CursorMode) Error!void { try checkError(); } +/// Set the size callback. +pub fn setSizeCallback(self: Window, callback: GLFWwindowsizefun) Error!void { + _ = glfwSetWindowSizeCallback(self.pimpl, callback); + try checkError(); +} + /// Set the key callback. pub fn setKeyCallback(self: Window, callback: GLFWkeyfun) Error!void { _ = glfwSetKeyCallback(self.pimpl, callback); |