* glfw: window hint default values parity test with attributes
* glfw: add test-mode-only variable that controls whether to set or ignore the `Window.Hints` struct passed to `Window.create`, and inline `failedToCreateWindow`
* glfw: include `context_no_error` hint/attribute in test with comment, fix oversight in `create` concerning the `defer defaultHints()` statement
Co-authored-by: Stephen Gutekanst <stephen.gutekanst@gmail.com>
* glfw: make comments into doc comments
* glfw: Publicize Window.CursorPos, Window.Size, Window.Pos, and Window.FrameSize
* glfw: Make enum value name the same format as other enum value names
* glfw: Window hints rework patch
* glfw: Relegate `Window.hint` to testing; move it down to just above the tests to reflect this, add doc comment line
* glfw: handle error `Error.InvalidEnum` explicitly, for clear error message in this unlikely edge case
* glfw: instate `Hint.context_no_error` as a hint, as it actually is specified to be a Window creation hint by the docs, and affirm removal of `Hint.context_revision`, which isn't.
The docs don't seem to specify a default value for `Hints.context_no_error` to take on, so we could set it based on `std.debug.runtime_safety` like this.
* glfw: default `context_no_error` to `false`, and added a note of caution about its usage as suggested.
* glfw: Inline enum values of `ClientApi`, `ContextCreationApi`, `ContextRobustness`, `ContextReleaseBehavior`, and `OpenGlProfile` from consts.zig, and remove the now unused constants (replaced by aformentioned enum values).
* glfw: Reference `Window.Hint` enum instead of `Window.Hints` struct to ensure fields are the same
* glfw: add comment explaining default values of `Window.Hints`
* glfw: change `OpenGlProfile` to `OpenGLProfile` based on established naming convention
* glfw: Update actual declaration of `OpenGLProfile`
* glfw: call `Window.defaultHints` after window creation, not before
* glfw: remove 'consts.zig', and move `dont_care` directly into 'main.zig'; fix anything referencing it.
* glfw: put `Window.defaultHints` into defer statement to handle cleanup in all paths
* glfw: move `Hint.focused` to match position of `Hints.focused`
* glfw: do 'zig fmt glfw/src'
* glfw: Cull `Window.Hint` comments, polish remaining; match order entirely according to current GLFW docs
* glfw: Change `Window.Hints.*Api` to `Window.Hints.*API`
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
Having `glfw.getProcAddress` conform to the GLFW C ABI is important as it is often
likely to be passed into libraries which expect exactly that ABI for OpenGL function
loading.
Fixeshexops/mach#52
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Having `glfw.getInstanceProcAddress` conform to the GLFW C ABI is important as it is often
likely to be passed into libraries which expect exactly that ABI, e.g. zig-vulkan.
Fixeshexops/mach#49
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
* move key values in an enum
* bitmask for key modifiers
* export Key type and move key fns
instead of exporting the key file, export Key enum.
functions related to the Key type are moved into the enum as well so that they get exported with the type