Stephen Gutekanst
5b4b31de13
glfw: update core APIs to glfw@master
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
d61362d8fb
glfw: expose Native BackendOptions
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-26 23:34:17 -07:00
Lee Cannon
2e9347399d
glfw: dont use @errSetCast
2022-02-08 19:58:52 -07:00
Lee Cannon
3e79a12f3d
glfw: dont call getError unless we need to
2022-02-08 19:57:20 -07:00
Ali Chraghi
494eb81b56
glfw: expose glfwSetErrorCallback for retrieving optional error descriptions
2021-12-25 11:32:12 -07:00
iddev5
4f35c578a0
glfw: Add ziggified API of glfw3native.h
2021-12-23 00:57:29 -07:00
InKryption
b8c913cd6c
glfw: remove TODOs
2021-12-08 19:30:01 -08:00
InKryption
3648d6b9c4
glfw: Denormalize errors ( #115 )
...
Closes hexops/mach#96
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2021-12-06 21:52:15 -07:00
InKryption
1d648c2256
glfw: Eliminate Error.InvalidValue
2021-11-26 20:50:38 -07:00
InKryption
fb0c695bd1
glfw: Eliminate InvalidEnum
2021-11-24 05:14:48 -07:00
InKryption
88e0d37325
glfw: enum-ify 'Joystick.jid', set 'InvalidEnum' as unreachable, and run zig fmt
2021-11-22 12:59:11 -07:00
InKryption
d9e2505b59
glfw: amend and update various TODOs pertaining to force-init changes
2021-11-22 12:59:11 -07:00
InKryption
ef7ada052c
glfw: Revert error denormalization
2021-11-22 12:59:11 -07:00
InKryption
44fee8f1f1
glfw: force init error type work around
2021-11-22 12:59:11 -07:00
InKryption
c6310dc377
glfw: force init in main.zig
2021-11-22 12:59:11 -07:00
Silver
673ce14acf
glfw: remove [*c] pointers from api and return lengthed strings when possible
2021-11-16 07:12:02 -07:00
InKryption
28a0aebd95
glfw: window hints rework ( #71 )
...
* 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>
2021-11-15 18:41:16 -07:00
InKryption
e9175fb9f1
glfw: change init function to accept hints as paramaters via new InitHints struct which has default field values reflecting the default values specified by GLFW current documentation, privatize hint-setting wrapper API, and update tests
2021-11-10 11:42:24 -07:00
Stephen Gutekanst
7264741ede
glfw: make init hints a proper enum
...
Helps hexops/mach#37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
4d1b92666b
glfw: expose aliased gamepad axis/button constants
...
Helps hexops/mach#37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
ab01edee1c
glfw: glfw.mod.Mods -> glfw.Mods, etc. & fix test compilation
...
Helps hexops/mach#37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
210e12a437
glfw: ziggify gamepad button enumerations
...
Helps hexops/mach#37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
2154ee5aea
glfw: ziggify gamepad action enumerations
...
Helps hexops/mach#37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
8a14d56fc3
glfw: ziggify all Action enums
...
Make the GLFW action enumerations proper Zig enums so one can use `.Name` syntax, etc.
Helps #37
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-29 21:27:20 -07:00
Aksel Hjerpbakk
1a3f391891
glfw: enums ( #41 )
...
* 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
2021-10-24 06:23:20 -07:00
Stephen Gutekanst
3e466da662
glfw: add glfw.key.getName
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
9d95c18d4c
glfw: add glfw.rawMouseMotionSupported
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-22 00:35:34 -07:00
Stephen Gutekanst
7d9b626b11
glfw: move remaining input TODOs to final locations
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-22 00:35:34 -07:00
Stephen Gutekanst
06fefd4026
glfw: rename joystick -> Joystick; add Joystick.getGamepadState
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-22 00:35:34 -07:00
Stephen Gutekanst
fcbfe70c66
glfw: add glfw.postEmptyEvent
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
6a124e35f9
glfw: add glfw.waitEvents, glfw.waitEventsTimeout
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
522f26e15f
glfw: add glfw.pollEvents
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
41c2ef44c1
glfw: add TODOs for tracking 100% GLFW API coverage
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
4f1c6d1b58
glfw: add Image type
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-20 21:00:05 -07:00
Stephen Gutekanst
a9446f4ed6
glfw: add Window.shouldClose
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 21:57:46 -07:00
Stephen Gutekanst
badc8939b5
glfw: add Window.destroy
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 21:45:25 -07:00
Stephen Gutekanst
04a213b411
glfw: cleanup two tests
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 21:37:05 -07:00
Stephen Gutekanst
c2af312200
glfw: use Window.create in basic test
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 21:36:14 -07:00
Stephen Gutekanst
441d8d7928
glfw: add Window.defaultHints
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 17:47:07 -07:00
Stephen Gutekanst
b5d1ebd1cd
glfw: window open test is optional (cannot open windows on CI)
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-18 15:38:53 -07:00
Stephen Gutekanst
ceabcec7a3
glfw: add GammaRamp type
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-17 21:29:51 -07:00
Stephen Gutekanst
72f09b4f32
glfw: fix and test VideoMode getters
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-17 20:56:48 -07:00
Stephen Gutekanst
5238e52d76
glfw: add Monitor.setGamma; return concrete Error types
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-17 20:50:41 -07:00
Stephen Gutekanst
b76e8d02f2
glfw: deduplicate @cImport for type equivalence
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-17 20:14:09 -07:00
Stephen Gutekanst
26e0db2064
glfw: always check init errors
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-17 13:59:26 -07:00
Stephen Gutekanst
5f4fb8b400
glfw: only keep test window open for 100ms
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-16 17:09:28 -07:00
Stephen Gutekanst
8ade50719d
glfw: correctly test Monitor implementation
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-16 16:56:58 -07:00
Stephen Gutekanst
04cbfb2e1e
glfw: add monitor.getAll support
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-16 16:36:57 -07:00
Stephen Gutekanst
1cedf40671
glfw: make init inline
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-16 16:35:42 -07:00
Stephen Gutekanst
bda78aca74
glfw: add getVersionString
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-16 16:00:28 -07:00