package glfw-ocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=bdf85f62da32f1b90f4fbb65e882583e
sha512=a3700bb390d4ad7ddfc877b838c43313510ee5f1981279462da9df3dcbf3cd529112236e530630cc150f39d553962f29e0041ee87f7f25fd1035db47f9d1691c
doc/glfw-ocaml/GLFW/index.html
Module GLFW
Source
OCaml binding for GLFW 3.2.1
GLFW-OCaml version numbers.
Exceptions raised by the various functions of this module.
If you ever get an InvalidEnum exception and are not using unsafe features that would be a bug in GLFW-OCaml. Please fill an issue on GitHub.
Key actions.
type key =
| Unknown
| Space
| Apostrophe
| Comma
| Minus
| Period
| Slash
| Num0
| Num1
| Num2
| Num3
| Num4
| Num5
| Num6
| Num7
| Num8
| Num9
| Semicolon
| Equal
| A
| B
| C
| D
| E
| F
| G
| H
| I
| J
| K
| L
| M
| N
| O
| P
| Q
| R
| S
| T
| U
| V
| W
| X
| Y
| Z
| LeftBracket
| Backslash
| RightBracket
| GraveAccent
| World1
| World2
| Escape
| Enter
| Tab
| Backspace
| Insert
| Delete
| Right
| Left
| Down
| Up
| PageUp
| PageDown
| Home
| End
| CapsLock
| ScrollLock
| NumLock
| PrintScreen
| Pause
| F1
| F2
| F3
| F4
| F5
| F6
| F7
| F8
| F9
| F10
| F11
| F12
| F13
| F14
| F15
| F16
| F17
| F18
| F19
| F20
| F21
| F22
| F23
| F24
| F25
| Kp0
| Kp1
| Kp2
| Kp3
| Kp4
| Kp5
| Kp6
| Kp7
| Kp8
| Kp9
| KpDecimal
| KpDivide
| KpMultiply
| KpSubtract
| KpAdd
| KpEnter
| KpEqual
| LeftShift
| LeftControl
| LeftAlt
| LeftSuper
| RightShift
| RightControl
| RightAlt
| RightSuper
| Menu
Keyboard keys.
Keyboard key and mouse button modifiers.
Maximum number of buttons handled for a mouse.
Maximum number of buttons handled for a joystick.
Client OpenGL API hint
Context robustness hint
OpenGL profile hint
Context release behavior hint
Context creation API hint
Window hints. Use with setWindowHint like this:
Windows attributes. Use with getWindowAttrib in a similar manner as with window hints.
Mouse cursor input mode.
type _ input_mode =
| Cursor : cursor_mode input_mode
| StickyKeys : bool input_mode
| StickyMouseButtons : bool input_mode
Input modes. Use with setInputMode and getInputMode in a similar manner as with window hints.
Standard cursor shapes.
Joystick connection event.
Video mode description as returned by getVideoMode(s).
Image data for creating custom cursors.
Module functions. These are mostly identical to their original GLFW counterparts.
There are no bindings for the glfwSetWindowUserPointer and glfwGetWindowUserPointer functions because you would have to use unsafe features to set the correct type for your data. If you need to make user data accessible inside a callback you can instead capture it in a closure and use that closure as your callback function.
There is no binding for the glfwGetProcAddress function because it would basicaly require to write an entire OpenGL wrapper to make the functions returned by GLFW usable from OCaml. Incidentaly the glfwExtensionSupported function is not provided either. There are numerous OpenGL bindings available for OCaml that you can use instead.
The Vulkan related functions are not supported as of now but we might look into it at some point.
val setMonitorCallback :
f:(monitor -> connection_event -> unit) option ->
(monitor -> connection_event -> unit) option
val setKeyCallback :
window:window ->
f:(window -> key -> int -> key_action -> key_mod list -> unit) option ->
(window -> key -> int -> key_action -> key_mod list -> unit) option
val setJoystickCallback :
f:(int -> connection_event -> unit) option ->
(int -> connection_event -> unit) option