compat.dox 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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](http://www.tronche.com/gui/x/icccm/)
  20. (ICCCM) and
  21. [Extended Window Manager Hints](http://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](http://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](http://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_glx GLX extensions
  69. The GLX API is the default API used to create OpenGL contexts on Unix-like
  70. systems using the X Window System.
  71. GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
  72. formats. If GLX 1.3 is not supported, @ref glfwInit will fail.
  73. GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
  74. `GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
  75. (or _vsync_), in that order of preference. Where none of these extension are
  76. available, calling @ref glfwSwapInterval will have no effect.
  77. GLFW uses the `GLX_ARB_multisample` extension to create contexts with
  78. multisampling anti-aliasing. Where this extension is unavailable, the
  79. `GLFW_SAMPLES` hint will have no effect.
  80. GLFW uses the `GLX_ARB_create_context` extension when available, even when
  81. creating OpenGL contexts of version 2.1 and below. Where this extension is
  82. unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
  83. hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
  84. will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
  85. `GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
  86. glfwCreateWindow to fail.
  87. GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
  88. context profiles. Where this extension is unavailable, setting the
  89. `GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
  90. `GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` or `GLFW_NO_API` will cause
  91. @ref glfwCreateWindow to fail.
  92. GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
  93. whether a context is flushed when it is released (made non-current). Where this
  94. extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
  95. effect and the context will always be flushed when released.
  96. GLFW uses the `GLX_ARB_framebuffer_sRGB` and `GLX_EXT_framebuffer_sRGB`
  97. extensions to provide support for sRGB framebuffers. Where both of these
  98. extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
  99. @section compat_wgl WGL extensions
  100. The WGL API is used to create OpenGL contexts on Microsoft Windows and other
  101. implementations of the Win32 API, such as Wine.
  102. GLFW uses either the `WGL_EXT_extension_string` or the
  103. `WGL_ARB_extension_string` extension to check for the presence of all other WGL
  104. extensions listed below. If both are available, the EXT one is preferred. If
  105. neither is available, no other extensions are used and many GLFW features
  106. related to context creation will have no effect or cause errors when used.
  107. GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
  108. synchronization (or _vsync_). Where this extension is unavailable, calling @ref
  109. glfwSwapInterval will have no effect.
  110. GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
  111. create contexts with multisampling anti-aliasing. Where these extensions are
  112. unavailable, the `GLFW_SAMPLES` hint will have no effect.
  113. GLFW uses the `WGL_ARB_create_context` extension when available, even when
  114. creating OpenGL contexts of version 2.1 and below. Where this extension is
  115. unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
  116. hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
  117. will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
  118. `GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
  119. glfwCreateWindow to fail.
  120. GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
  121. context profiles. Where this extension is unavailable, setting the
  122. `GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
  123. @ref glfwCreateWindow to fail.
  124. GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
  125. whether a context is flushed when it is released (made non-current). Where this
  126. extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
  127. effect and the context will always be flushed when released.
  128. GLFW uses the `WGL_ARB_framebuffer_sRGB` and `WGL_EXT_framebuffer_sRGB`
  129. extensions to provide support for sRGB framebuffers. Where both of these
  130. extension are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
  131. @section compat_osx OpenGL on macOS
  132. Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
  133. only forward-compatible, core profile contexts are supported. Support for
  134. OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
  135. core profile contexts. There is also still no mechanism for requesting debug
  136. contexts or no-error contexts. Versions of Mac OS X earlier than 10.7 support
  137. at most OpenGL version 2.1.
  138. Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
  139. `GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
  140. given version 3.0 or 3.1. The `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
  141. `GLFW_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
  142. `GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts. The
  143. `GLFW_OPENGL_DEBUG_CONTEXT` and `GLFW_CONTEXT_NO_ERROR` hints are ignored.
  144. Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
  145. `GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
  146. setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
  147. a non-default value will cause @ref glfwCreateWindow to fail and the
  148. `GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
  149. @section compat_vulkan Vulkan loader and API
  150. By default, GLFW uses the standard system-wide Vulkan loader to access the
  151. Vulkan API on all platforms except macOS. This is installed by both graphics
  152. drivers and Vulkan SDKs. If either the loader or at least one minimally
  153. functional ICD is missing, @ref glfwVulkanSupported will return `GLFW_FALSE` and
  154. all other Vulkan-related functions will fail with an @ref GLFW_API_UNAVAILABLE
  155. error.
  156. @section compat_wsi Vulkan WSI extensions
  157. The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on
  158. all supported platforms.
  159. GLFW uses the `VK_KHR_surface` and `VK_KHR_win32_surface` extensions to create
  160. surfaces on Microsoft Windows. If any of these extensions are not available,
  161. @ref glfwGetRequiredInstanceExtensions will return an empty list and window
  162. surface creation will fail.
  163. GLFW uses the `VK_KHR_surface` and `VK_MVK_macos_surface` extensions to create
  164. surfaces on macOS. If any of these extensions are not available, @ref
  165. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  166. creation will fail.
  167. GLFW uses the `VK_KHR_surface` and either the `VK_KHR_xlib_surface` or
  168. `VK_KHR_xcb_surface` extensions to create surfaces on X11. If `VK_KHR_surface`
  169. or both `VK_KHR_xlib_surface` and `VK_KHR_xcb_surface` are not available, @ref
  170. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  171. creation will fail.
  172. GLFW uses the `VK_KHR_surface` and `VK_KHR_wayland_surface` extensions to create
  173. surfaces on Wayland. If any of these extensions are not available, @ref
  174. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  175. creation will fail.
  176. GLFW uses the `VK_KHR_surface` and `VK_KHR_mir_surface` extensions to create
  177. surfaces on Mir. If any of these extensions are not available, @ref
  178. glfwGetRequiredInstanceExtensions will return an empty list and window surface
  179. creation will fail.
  180. */