core window doesn't have reference to glfw window anymore!

This commit is contained in:
Mitchell Hashimoto
2022-12-30 15:18:32 -08:00
parent fe84686a1d
commit ba0cbecd79
3 changed files with 12 additions and 11 deletions

View File

@@ -184,6 +184,15 @@ pub const Window = struct {
self.window.setShouldClose(true);
}
/// Returns true if the window is flagged to close.
pub fn shouldClose(self: *const Window) bool {
return self.window.shouldClose();
}
pub fn setTitle(self: *Window, slice: [:0]const u8) !void {
try self.window.setTitle(slice.ptr);
}
/// The cursor position from glfw directly is in screen coordinates but
/// all our interface works in pixels.
fn cursorPosToPixels(self: *const Window, pos: glfw.Window.CursorPos) !glfw.Window.CursorPos {