Commit graph

127 commits

Author SHA1 Message Date
Stephen Gutekanst
93200dbe00 glfw: add setInputModeCursor/getInputModeCursor variants
Helps hexops/mach#37

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
be9bbe8f21 glfw: make mouse buttons 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
1158c52f0c glfw: make Window attributes 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
1c8bb772c0 glfw: make Window 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
d951a47348 glfw: make setKeyCallback use Key enum directly
Helps hexops/mach#37

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
fc6ac619c3 glfw: make setMouseButtonCallback use Mods bitmask directly
Helps hexops/mach#37

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
36bbd817af glfw: make Window.setKeyCallback use Mods packed struct directly
Helps hexops/mach#37

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-30 20:06:03 -07:00
Stephen Gutekanst
18226db9fd 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
159bcb0255 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
2fcb17dc8e glfw: set input mode supported on all platforms in test
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
39362c7cd0 glfw: add glfw.Window.getInputMode
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
34612df98b glfw: add glfw.Window.setInputMode
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
6120236d85 glfw: add glfw.Window.getKey
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
c5b3eed9e4 glfw: add glfw.Window.getMouseButton
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
63d68f8c19 glfw: add glfw.Window.getCursorPos
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
1000d55043 glfw: add glfw.Window.setCursorPos
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
96c2632764 glfw: add Window.setCursor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
c3b7a80658 glfw: correct test order
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
8ff62d8cdf glfw: add glfw.Window.setKeyCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
eb34abdb88 glfw: add glfw.Window.setCharCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
0c31bb56ca glfw: add glfw.Window.setMouseButtonCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
d44ef26b2f glfw: add glfw.Window.setCursorPosCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
8d37cb0046 glfw: add glfw.Window.setCursorEnterCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
3919846586 glfw: add glfw.Window.setScrollCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
e01685ea02 glfw: add glfw.Window.setDropCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-23 19:33:33 -07:00
Stephen Gutekanst
8d50b33c8a glfw: move remaining input TODOs to final locations
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-22 00:35:34 -07:00
pfg
e0b9f995af glfw: fix getWindowPos (#35) 2021-10-19 15:01:17 -07:00
Stephen Gutekanst
8f7d3ef5bb zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
d0fb09be91 glfw: add Window.getMonitor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
a98e437bcd glfw: add Window.setContentScaleCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
5dc41a130a glfw: add Window.setFramebufferSizeCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
187efce69d glfw: add Window.setMaximizeCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
f73f86f14c glfw: add Window.setIconifyCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
89c7753af8 glfw: add Window.setFocusCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
293b3e1a96 glfw: add Window.setRefreshCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
5e154a0ffa glfw: add Window.setCloseCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
1c7196e0c2 glfw: add Window.setSizeCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
0ed547af0e glfw: add system for nice Zig callbacks, add Window.setPosCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
c7161afec3 glfw: add Window.getUserPointer
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
9f7e2e4a55 glfw: add Window.setUserPointer
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
d6edb13c19 glfw: add Window.setAttrib
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
cc9dccf5a1 glfw: add Window.getAttrib
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Stephen Gutekanst
ceec340d95 glfw: add Window.setMonitor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-18 20:52:34 -07:00
Aksel Hjerpbakk
06e114c2dd glfw: support multiple types from glfw.Window.hint (#32)
* glfw #29: support multiple types from glfw.Window.hint

* use 'got' instead of 'not' in error messages
2021-10-18 13:19:25 -07:00
Stephen Gutekanst
3182eaa4f7 glfw: update TODOs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
0b39f6c738 glfw: add glfw.Window.swapBuffers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
7ba458d25b 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
477240681b glfw: add Window.requestAttention
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
aaa7747e18 glfw: add Window.focus
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00
Stephen Gutekanst
8bb8227b89 glfw: add Window.hide
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-16 18:39:57 -07:00