mach/libs/glfw/src
Lue eed2be4591 glfw: refactor getError and related functions
`getError()` now returns a struct `Error` containing `error_code` and
`description`. Rationale: retrieving the error code with the previous
implementation of `getError()` caused `getErrorString()` to return
null (the reverse is also true). The new implementation allows both
values to be retrieved at once.

The previous `getError()` function has been renamed to
`getErrorCode()` to reflect the fact that it returns a simple Zig
error rather than the `Error` struct. The error set returned by
`getErrorCode()` is now named `ErrorCode` rather than `Error`.

The behavior of the `getError()` family of functions clearing the
stored error is unchanged. However, since all code that used
`defer glfw.getError() catch {}` to explicitly clear errors had to be
refactored, a new `glfw.clearError()` function that returns void is
now available to make this operation more explicit.

Additionally, `mustGetError()` is now `mustGetErrorCode()`, and new
functions `mustGetError()` and `mustGetErrorString()` have been added
which wrap `getError()` and `getErrorString()` but panic if no error
is actually available.

Tests and API documentation had to be refactored across all of
`mach/glfw`. This commit also takes the opportunity to skip tests
involving window creation on CI so that other tests may still execute
normally.
2023-01-10 20:52:41 -07:00
..
cimport glfw: remove self-hosted compiler workaround 2022-10-15 07:56:18 -07:00
action.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
allocator.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
c.zig all: revert cimport workaround 2022-09-07 21:24:47 -07:00
clipboard.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
Cursor.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
errors.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
gamepad_axis.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
gamepad_button.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
GammaRamp.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
hat.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
Image.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
internal_debug.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
Joystick.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
key.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
main.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
mod.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
Monitor.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
mouse_button.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
native.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
opengl.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
sources_all.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_linux.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_linux_wayland.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_linux_x11.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_macos.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_macos.m all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
sources_windows.c all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
time.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
version.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
VideoMode.zig all: move standalone libraries to libs/ subdirectory 2022-08-26 15:12:04 -07:00
vulkan.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00
Window.zig glfw: refactor getError and related functions 2023-01-10 20:52:41 -07:00