compat.dox 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*!
  2. @page compat_guide Standards conformance
  3. @tableofcontents
  4. This guide describes the various API extensions used by this version of GLFW.
  5. It lists what are essentially implementation details, but which are nonetheless
  6. vital knowledge for developers intending to deploy their applications on a wide
  7. range of machines.
  8. The information in this guide is not a part of GLFW API, but merely
  9. preconditions for some parts of the library to function on a given machine. Any
  10. part of this information may change in future versions of GLFW and that will not
  11. be considered a breaking API change.
  12. @section compat_x11 X11 extensions, protocols and IPC standards
  13. As GLFW uses Xlib directly, without any intervening toolkit
  14. library, it has sole responsibility for interacting well with the many and
  15. varied window managers in use on Unix-like systems. In order for applications
  16. and window managers to work well together, a number of standards and
  17. conventions have been developed that regulate behavior outside the scope of the
  18. X11 API; most importantly the
  19. [Inter-Client Communication Conventions Manual](https://www.tronche.com/gui/x/icccm/)
  20. (ICCCM) and
  21. [Extended Window Manager Hints](https://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
  22. (EWMH) standards.
  23. GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows.
  24. If the running window manager does not support this property, the
  25. `GLFW_DECORATED` hint will have no effect.
  26. GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user
  27. attempting to close the GLFW window. If the running window manager does not
  28. support this protocol, the close callback will never be called.
  29. GLFW uses the EWMH `_NET_WM_PING` protocol, allowing the window manager notify
  30. the user when the application has stopped responding, i.e. when it has ceased to
  31. process events. If the running window manager does not support this protocol,
  32. the user will not be notified if the application locks up.
  33. GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window
  34. manager to make the GLFW window full screen. If the running window manager does
  35. not support this state, full screen windows may not work properly. GLFW has
  36. a fallback code path in case this state is unavailable, but every window manager
  37. behaves slightly differently in this regard.
  38. GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a
  39. compositing window manager to un-redirect full screen GLFW windows. If the
  40. running window manager uses compositing but does not support this property then
  41. additional copying may be performed for each buffer swap of full screen windows.
  42. GLFW uses the
  43. [clipboard manager protocol](https://www.freedesktop.org/wiki/ClipboardManager/)
  44. to push a clipboard string (i.e. selection) owned by a GLFW window about to be
  45. destroyed to the clipboard manager. If there is no running clipboard manager,
  46. the clipboard string will be unavailable once the window has been destroyed.
  47. GLFW uses the
  48. [X drag-and-drop protocol](https://www.freedesktop.org/wiki/Specifications/XDND/)
  49. to provide file drop events. If the application originating the drag does not
  50. support this protocol, drag and drop will not work.
  51. GLFW uses the XRandR 1.3 extension to provide multi-monitor support. If the
  52. running X server does not support this version of this extension, multi-monitor
  53. support will not function and only a single, desktop-spanning monitor will be
  54. reported.
  55. GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp
  56. support. If the running X server does not support either or both of these
  57. extensions, gamma ramp support will not function.
  58. GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard
  59. input. If the running X server does not support this extension, a non-Xkb
  60. fallback path is used.
  61. GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion
  62. when the cursor is disabled. If the running X server does not support this
  63. extension, regular accelerated mouse motion will be used.
  64. GLFW uses both the XRender extension and the compositing manager to support
  65. transparent window framebuffers. If the running X server does not support this
  66. extension or there is no running compositing manager, the
  67. `GLFW_TRANSPARENT_FRAMEBUFFER` framebuffer hint will have no effect.
  68. @section compat_wayland Wayland protocols and IPC standards
  69. As GLFW uses libwayland directly, without any intervening toolkit library, it
  70. has sole responsibility for interacting well with every compositor in use on
  71. Unix-like systems. Most of the features are provided by the core protocol,
  72. while cursor support is provided by the libwayland-cursor helper library, EGL
  73. integration by libwayland-egl, and keyboard handling by
  74. [libxkbcommon](https://xkbcommon.org/). In addition, GLFW uses some protocols
  75. from wayland-protocols to provide additional features if the compositor
  76. supports them.
  77. GLFW uses xkbcommon 0.5.0 to provide compose key support. When it has been
  78. built against an older xkbcommon, the compose key will be disabled even if it
  79. has been configured in the compositor.
  80. GLFW uses the [xdg-shell
  81. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml)
  82. to provide better window management. This protocol is part of
  83. wayland-protocols 1.12, and mandatory at build time.
  84. GLFW uses the [relative pointer
  85. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml)
  86. alongside the [pointer constraints
  87. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml)
  88. to implement disabled cursor. These two protocols are part of
  89. wayland-protocols 1.1, and mandatory at build time. If the running compositor
  90. does not support both of these protocols, disabling the cursor will have no
  91. effect.
  92. GLFW uses the [idle inhibit
  93. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml)
  94. to prohibit the screensaver from starting. This protocol is part of
  95. wayland-protocols 1.6, and mandatory at build time. If the running compositor
  96. does not support this protocol, the screensaver may start even for full screen
  97. windows.
  98. GLFW uses the [libdecor library](https://gitlab.freedesktop.org/libdecor/libdecor)
  99. for window decorations, where available. This in turn provides good quality
  100. client-side decorations (drawn by the application) on desktop systems that do
  101. not support server-side decorations (drawn by the window manager). On systems
  102. that do not provide either libdecor or xdg-decoration, very basic window
  103. decorations are provided. These do not include the window title or any caption
  104. buttons.
  105. GLFW uses the [xdg-decoration
  106. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
  107. to request decorations to be drawn around its windows. This protocol is part
  108. of wayland-protocols 1.15, and mandatory at build time. If the running
  109. compositor does not support this protocol, a very simple frame will be drawn by
  110. GLFW itself, using the [viewporter
  111. protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml)
  112. alongside
  113. [subsurfaces](https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2598).
  114. This protocol is part of wayland-protocols 1.4, and mandatory at build time.
  115. If the running compositor does not support this protocol either, no decorations
  116. will be drawn around windows.
  117. @section compat_glx GLX extensions
  118. The GLX API is the default API used to create OpenGL contexts on Unix-like
  119. systems using the X Window System.
  120. GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
  121. formats. If GLX 1.3 is not supported, @ref glfwInit will fail.
  122. GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
  123. `GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
  124. (or _vsync_), in that order of preference. When none of these extensions are
  125. available, calling @ref glfwSwapInterval will have no effect.
  126. GLFW uses the `GLX_ARB_multisample` extension to create contexts with
  127. multisampling anti-aliasing. Where this extension is unavailable, the
  128. `GLFW_SAMPLES` hint will have no effect.
  129. GLFW uses the `GLX_ARB_create_context` extension when available, even when
  130. creating OpenGL contexts of version 2.1 and below. Where this extension is
  131. unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
  132. hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
  133. will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
  134. `GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
  135. glfwCreateWindow to fail.
  136. GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
  137. context profiles. Where this extension is unavailable, setting the
  138. `GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
  139. `GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` or `GLFW_NO_API` will cause
  140. @ref glfwCreateWindow to fail.
  141. GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
  142. whether a context is flushed when it is released (made non-current). Where this
  143. extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
  144. effect and the context will always be flushed when released.
  145. GLFW uses the `GLX_ARB_framebuffer_sRGB` and `GLX_EXT_framebuffer_sRGB`
  146. extensions to provide support for sRGB framebuffers. Where both of these
  147. extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
  148. @section compat_wgl WGL extensions
  149. The WGL API is used to create OpenGL contexts on Microsoft Windows and other
  150. implementations of the Win32 API, such as Wine.
  151. GLFW uses either the `WGL_EXT_extension_string` or the
  152. `WGL_ARB_extension_string` extension to check for the presence of all other WGL
  153. extensions listed below. If both are available, the EXT one is preferred. If
  154. neither is available, no other extensions are used and many GLFW features
  155. related to context creation will have no effect or cause errors when used.
  156. GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
  157. synchronization (or _vsync_). Where this extension is unavailable, calling @ref
  158. glfwSwapInterval will have no effect.
  159. GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
  160. create contexts with multisampling anti-aliasing. Where these extensions are
  161. unavailable, the `GLFW_SAMPLES` hint will have no effect.
  162. GLFW uses the `WGL_ARB_create_context` extension when available, even when
  163. creating OpenGL contexts of version 2.1 and below. Where this extension is
  164. unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
  165. hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
  166. will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
  167. `GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
  168. glfwCreateWindow to fail.
  169. GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
  170. context profiles. Where this extension is unavailable, setting the
  171. `GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
  172. @ref glfwCreateWindow to fail.
  173. GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
  174. whether a context is flushed when it is released (made non-current). Where this
  175. extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
  176. effect and the context will always be flushed when released.
  177. GLFW uses the `WGL_ARB_framebuffer_sRGB` and `WGL_EXT_framebuffer_sRGB`
  178. extensions to provide support for sRGB framebuffers. When both of these
  179. extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
  180. @section compat_osx OpenGL on macOS
  181. Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
  182. only forward-compatible, core profile contexts are supported. Support for
  183. OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
  184. core profile contexts. There is also still no mechanism for requesting debug
  185. contexts or no-error contexts. Versions of Mac OS X earlier than 10.7 support
  186. at most OpenGL version 2.1.
  187. Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
  188. `GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
  189. given version 3.0 or 3.1. The `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
  190. `GLFW_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
  191. `GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts. The
  192. `GLFW_OPENGL_DEBUG_CONTEXT` and `GLFW_CONTEXT_NO_ERROR` hints are ignored.
  193. Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
  194. `GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
  195. setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
  196. a non-default value will cause @ref glfwCreateWindow to fail and the
  197. `GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
  198. @section compat_vulkan Vulkan loader and API
  199. By default, GLFW uses the standard system-wide Vulkan loader to access the
  200. Vulkan API on all platforms except macOS. This is installed by both graphics
  201. drivers and Vulkan SDKs. If either the loader or at least one minimally
  202. functional ICD is missing, @ref glfwVulkanSupported will return `GLFW_FALSE` and
  203. all other Vulkan-related functions will fail with an @ref GLFW_API_UNAVAILABLE
  204. error.
  205. @section compat_wsi Vulkan WSI extensions
  206. The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on
  207. all supported platforms.
  208. GLFW uses the `VK_KHR_surface` and `VK_KHR_win32_surface` extensions to create
  209. surfaces on Microsoft Windows. If any of these extensions are not available,
  210. @ref glfwGetRequiredInstanceExtensions will return an empty list and window
  211. surface creation will fail.
  212. GLFW uses the `VK_KHR_surface` and either the `VK_MVK_macos_surface` or
  213. `VK_EXT_metal_surface` extensions to create surfaces on macOS. If any of these
  214. extensions are not available, @ref glfwGetRequiredInstanceExtensions will
  215. return an empty list and window surface creation will fail.
  216. GLFW uses the `VK_KHR_surface` and either the `VK_KHR_xlib_surface` or
  217. `VK_KHR_xcb_surface` extensions to create surfaces on X11. If `VK_KHR_surface`
  218. or both `VK_KHR_xlib_surface` and `VK_KHR_xcb_surface` are not available, @ref
  219. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  220. creation will fail.
  221. GLFW uses the `VK_KHR_surface` and `VK_KHR_wayland_surface` extensions to create
  222. surfaces on Wayland. If any of these extensions are not available, @ref
  223. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  224. creation will fail.
  225. */