glfw: accept null cursor in Window.setCursor
This commit is contained in:
parent
6cd186fcab
commit
5e2abcbe22
1 changed files with 2 additions and 2 deletions
|
@ -2059,9 +2059,9 @@ pub inline fn setCursorPos(self: Window, xpos: f64, ypos: f64) error{PlatformErr
|
|||
/// @thread_safety This function must only be called from the main thread.
|
||||
///
|
||||
/// see also: cursor_object
|
||||
pub inline fn setCursor(self: Window, cursor: Cursor) error{PlatformError}!void {
|
||||
pub inline fn setCursor(self: Window, cursor: ?Cursor) error{PlatformError}!void {
|
||||
internal_debug.assertInitialized();
|
||||
c.glfwSetCursor(self.handle, cursor.ptr);
|
||||
c.glfwSetCursor(self.handle, if (cursor) |cs| cs.ptr else null);
|
||||
getError() catch |err| return switch (err) {
|
||||
Error.NotInitialized => unreachable,
|
||||
Error.PlatformError => |e| e,
|
||||
|
|
Loading…
Add table
Reference in a new issue