compat.dox 11 KB

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