package glfw-ocaml

  1. Overview
  2. Docs

Deprecated window hints and attributes modules.

These modules used to wrap separate types that had some identical constructor names, allowing type safety for the window hints and attributes functions. Compared to the current implementation using GADTs and polymorphic variant types, it had two major disadvantages:

* It required adding module name prefixes when using the constructors; * Constructors related to a same feature would be duplicated across some totally incompatible types.

These modules are provided for API backward-compatibility and will be removed in the future (probably on the next major version). Most probably, updating your code is very straightforward and you simply need to remove the module name prefixes when using those constructors.

include module type of A with type ('a, 'k) window_attr = ('a, 'k) window_attr

Window hints and attributes. Use with windowHint, getWindowAttrib and setWindowAttrib like this:

windowHint ~hint:Resizable ~value:false windowHint ~hint:OpenGLProfile ~value:CoreProfile windowHint ~hint:RefreshRate ~value:(Some 60) windowHint ~hint:DepthBits ~value:None windowHint ~hint:X11ClassName ~value:"MyApplicationName"

getWindowAttrib ~attribute:Resizable : bool getWindowAttrib ~attribute:OpenGLProfile : opengl_profile getWindowAttrib ~attribute:Hovered : bool getWindowAttrib ~attribute:ContextRevision : int

setWindowAttrib ~attribute:Resizable ~value:true

This type is wrapped inside a module only for technical reasons related to backward-compatibility. That module is opened right after it is declared and it is intended that you use the constructor names unprefixed as shown in the previous examples. It will be removed together with the old modules in the future (probably on the next major version).

type ('a, 'k) window_attr = ('a, 'k) window_attr =
  1. | Focused : (bool, [< `hint | `attr ]) window_attr
  2. | Iconified : (bool, [< `attr ]) window_attr
  3. | Resizable : (bool, [< `hint | `attr | `update ]) window_attr
  4. | Visible : (bool, [< `hint | `attr ]) window_attr
  5. | Decorated : (bool, [< `hint | `attr | `update ]) window_attr
  6. | AutoIconify : (bool, [< `hint | `attr | `update ]) window_attr
  7. | Floating : (bool, [< `hint | `attr | `update ]) window_attr
  8. | Maximized : (bool, [< `hint | `attr ]) window_attr
  9. | CenterCursor : (bool, [< `hint ]) window_attr
  10. | TransparentFramebuffer : (bool, [< `hint | `attr ]) window_attr
  11. | Hovered : (bool, [< `attr ]) window_attr
  12. | FocusOnShow : (bool, [< `hint | `attr | `update ]) window_attr
  13. | RedBits : (int option, [< `hint ]) window_attr
  14. | GreenBits : (int option, [< `hint ]) window_attr
  15. | BlueBits : (int option, [< `hint ]) window_attr
  16. | AlphaBits : (int option, [< `hint ]) window_attr
  17. | DepthBits : (int option, [< `hint ]) window_attr
  18. | StencilBits : (int option, [< `hint ]) window_attr
  19. | AccumRedBits : (int option, [< `hint ]) window_attr
  20. | AccumGreenBits : (int option, [< `hint ]) window_attr
  21. | AccumBlueBits : (int option, [< `hint ]) window_attr
  22. | AccumAlphaBits : (int option, [< `hint ]) window_attr
  23. | AuxBuffers : (int option, [< `hint ]) window_attr
  24. | Stereo : (bool, [< `hint ]) window_attr
  25. | Samples : (int option, [< `hint ]) window_attr
  26. | SrgbCapable : (bool, [< `hint ]) window_attr
  27. | RefreshRate : (int option, [< `hint ]) window_attr
  28. | DoubleBuffer : (bool, [< `hint ]) window_attr
  29. | ClientApi : (client_api, [< `hint | `attr ]) window_attr
  30. | ContextVersionMajor : (int, [< `hint | `attr ]) window_attr
  31. | ContextVersionMinor : (int, [< `hint | `attr ]) window_attr
  32. | ContextRevision : (int, [< `attr ]) window_attr
  33. | ContextRobustness : (context_robustness, [< `hint | `attr ]) window_attr
  34. | OpenGLForwardCompat : (bool, [< `hint | `attr ]) window_attr
  35. | OpenGLDebugContext : (bool, [< `hint | `attr ]) window_attr
  36. | OpenGLProfile : (opengl_profile, [< `hint | `attr ]) window_attr
  37. | ContextReleaseBehavior : (context_release_behavior, [< `hint ]) window_attr
  38. | ContextNoError : (bool, [< `hint ]) window_attr
  39. | ContextCreationApi : (context_creation_api, [< `hint | `attr ]) window_attr
  40. | ScaleToMonitor : (bool, [< `hint ]) window_attr
  41. | CocoaRetinaFramebuffer : (bool, [< `hint ]) window_attr
  42. | CocoaFrameName : (string, [< `hint ]) window_attr
  43. | CocoaGraphicsSwitching : (bool, [< `hint ]) window_attr
  44. | X11ClassName : (string, [< `hint ]) window_attr
  45. | X11InstanceName : (string, [< `hint ]) window_attr
type 'a t