glfw3native.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. /*************************************************************************
  2. * GLFW 3.3 - www.glfw.org
  3. * A library for OpenGL, window and input
  4. *------------------------------------------------------------------------
  5. * Copyright (c) 2002-2006 Marcus Geelnard
  6. * Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
  7. *
  8. * This software is provided 'as-is', without any express or implied
  9. * warranty. In no event will the authors be held liable for any damages
  10. * arising from the use of this software.
  11. *
  12. * Permission is granted to anyone to use this software for any purpose,
  13. * including commercial applications, and to alter it and redistribute it
  14. * freely, subject to the following restrictions:
  15. *
  16. * 1. The origin of this software must not be misrepresented; you must not
  17. * claim that you wrote the original software. If you use this software
  18. * in a product, an acknowledgment in the product documentation would
  19. * be appreciated but is not required.
  20. *
  21. * 2. Altered source versions must be plainly marked as such, and must not
  22. * be misrepresented as being the original software.
  23. *
  24. * 3. This notice may not be removed or altered from any source
  25. * distribution.
  26. *
  27. *************************************************************************/
  28. #ifndef _glfw3_native_h_
  29. #define _glfw3_native_h_
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /*************************************************************************
  34. * Doxygen documentation
  35. *************************************************************************/
  36. /*! @file glfw3native.h
  37. * @brief The header of the native access functions.
  38. *
  39. * This is the header file of the native access functions. See @ref native for
  40. * more information.
  41. */
  42. /*! @defgroup native Native access
  43. * @brief Functions related to accessing native handles.
  44. *
  45. * **By using the native access functions you assert that you know what you're
  46. * doing and how to fix problems caused by using them. If you don't, you
  47. * shouldn't be using them.**
  48. *
  49. * Before the inclusion of @ref glfw3native.h, you may define zero or more
  50. * window system API macro and zero or more context creation API macros.
  51. *
  52. * The chosen backends must match those the library was compiled for. Failure
  53. * to do this will cause a link-time error.
  54. *
  55. * The available window API macros are:
  56. * * `GLFW_EXPOSE_NATIVE_WIN32`
  57. * * `GLFW_EXPOSE_NATIVE_COCOA`
  58. * * `GLFW_EXPOSE_NATIVE_X11`
  59. * * `GLFW_EXPOSE_NATIVE_WAYLAND`
  60. *
  61. * The available context API macros are:
  62. * * `GLFW_EXPOSE_NATIVE_WGL`
  63. * * `GLFW_EXPOSE_NATIVE_NSGL`
  64. * * `GLFW_EXPOSE_NATIVE_GLX`
  65. * * `GLFW_EXPOSE_NATIVE_EGL`
  66. * * `GLFW_EXPOSE_NATIVE_OSMESA`
  67. *
  68. * These macros select which of the native access functions that are declared
  69. * and which platform-specific headers to include. It is then up your (by
  70. * definition platform-specific) code to handle which of these should be
  71. * defined.
  72. *
  73. * If you do not want the platform-specific headers to be included, define
  74. * `GLFW_NATIVE_INCLUDE_NONE` before including the @ref glfw3native.h header.
  75. *
  76. * @code
  77. * #define GLFW_EXPOSE_NATIVE_WIN32
  78. * #define GLFW_EXPOSE_NATIVE_WGL
  79. * #define GLFW_NATIVE_INCLUDE_NONE
  80. * #include <GLFW/glfw3native.h>
  81. * @endcode
  82. */
  83. /*************************************************************************
  84. * System headers and types
  85. *************************************************************************/
  86. #if !defined(GLFW_NATIVE_INCLUDE_NONE)
  87. #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
  88. /* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
  89. * example to allow applications to correctly declare a GL_KHR_debug callback)
  90. * but windows.h assumes no one will define APIENTRY before it does
  91. */
  92. #if defined(GLFW_APIENTRY_DEFINED)
  93. #undef APIENTRY
  94. #undef GLFW_APIENTRY_DEFINED
  95. #endif
  96. #include <windows.h>
  97. #elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
  98. #if defined(__OBJC__)
  99. #import <Cocoa/Cocoa.h>
  100. #else
  101. #include <ApplicationServices/ApplicationServices.h>
  102. #include <objc/objc.h>
  103. #endif
  104. #elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
  105. #include <X11/Xlib.h>
  106. #include <X11/extensions/Xrandr.h>
  107. #elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
  108. #include <wayland-client.h>
  109. #endif
  110. #if defined(GLFW_EXPOSE_NATIVE_WGL)
  111. /* WGL is declared by windows.h */
  112. #endif
  113. #if defined(GLFW_EXPOSE_NATIVE_NSGL)
  114. /* NSGL is declared by Cocoa.h */
  115. #endif
  116. #if defined(GLFW_EXPOSE_NATIVE_GLX)
  117. /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
  118. * default it also acts as an OpenGL header
  119. * However, glx.h will include gl.h, which will define it unconditionally
  120. */
  121. #if defined(GLFW_GLAPIENTRY_DEFINED)
  122. #undef GLAPIENTRY
  123. #undef GLFW_GLAPIENTRY_DEFINED
  124. #endif
  125. #include <GL/glx.h>
  126. #endif
  127. #if defined(GLFW_EXPOSE_NATIVE_EGL)
  128. #include <EGL/egl.h>
  129. #endif
  130. #if defined(GLFW_EXPOSE_NATIVE_OSMESA)
  131. /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
  132. * default it also acts as an OpenGL header
  133. * However, osmesa.h will include gl.h, which will define it unconditionally
  134. */
  135. #if defined(GLFW_GLAPIENTRY_DEFINED)
  136. #undef GLAPIENTRY
  137. #undef GLFW_GLAPIENTRY_DEFINED
  138. #endif
  139. #include <GL/osmesa.h>
  140. #endif
  141. #endif /*GLFW_NATIVE_INCLUDE_NONE*/
  142. /*************************************************************************
  143. * Functions
  144. *************************************************************************/
  145. #if defined(GLFW_EXPOSE_NATIVE_WIN32)
  146. /*! @brief Returns the adapter device name of the specified monitor.
  147. *
  148. * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
  149. * of the specified monitor, or `NULL` if an [error](@ref error_handling)
  150. * occurred.
  151. *
  152. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  153. *
  154. * @thread_safety This function may be called from any thread. Access is not
  155. * synchronized.
  156. *
  157. * @since Added in version 3.1.
  158. *
  159. * @ingroup native
  160. */
  161. GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
  162. /*! @brief Returns the display device name of the specified monitor.
  163. *
  164. * @return The UTF-8 encoded display device name (for example
  165. * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
  166. * [error](@ref error_handling) occurred.
  167. *
  168. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  169. *
  170. * @thread_safety This function may be called from any thread. Access is not
  171. * synchronized.
  172. *
  173. * @since Added in version 3.1.
  174. *
  175. * @ingroup native
  176. */
  177. GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
  178. /*! @brief Returns the `HWND` of the specified window.
  179. *
  180. * @return The `HWND` of the specified window, or `NULL` if an
  181. * [error](@ref error_handling) occurred.
  182. *
  183. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  184. *
  185. * @remark The `HDC` associated with the window can be queried with the
  186. * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
  187. * function.
  188. * @code
  189. * HDC dc = GetDC(glfwGetWin32Window(window));
  190. * @endcode
  191. * This DC is private and does not need to be released.
  192. *
  193. * @thread_safety This function may be called from any thread. Access is not
  194. * synchronized.
  195. *
  196. * @since Added in version 3.0.
  197. *
  198. * @ingroup native
  199. */
  200. GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
  201. #endif
  202. #if defined(GLFW_EXPOSE_NATIVE_WGL)
  203. /*! @brief Returns the `HGLRC` of the specified window.
  204. *
  205. * @return The `HGLRC` of the specified window, or `NULL` if an
  206. * [error](@ref error_handling) occurred.
  207. *
  208. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  209. * GLFW_NOT_INITIALIZED.
  210. *
  211. * @remark The `HDC` associated with the window can be queried with the
  212. * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
  213. * function.
  214. * @code
  215. * HDC dc = GetDC(glfwGetWin32Window(window));
  216. * @endcode
  217. * This DC is private and does not need to be released.
  218. *
  219. * @thread_safety This function may be called from any thread. Access is not
  220. * synchronized.
  221. *
  222. * @since Added in version 3.0.
  223. *
  224. * @ingroup native
  225. */
  226. GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
  227. #endif
  228. #if defined(GLFW_EXPOSE_NATIVE_COCOA)
  229. /*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
  230. *
  231. * @return The `CGDirectDisplayID` of the specified monitor, or
  232. * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
  233. *
  234. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  235. *
  236. * @thread_safety This function may be called from any thread. Access is not
  237. * synchronized.
  238. *
  239. * @since Added in version 3.1.
  240. *
  241. * @ingroup native
  242. */
  243. GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
  244. /*! @brief Returns the `NSWindow` of the specified window.
  245. *
  246. * @return The `NSWindow` of the specified window, or `nil` if an
  247. * [error](@ref error_handling) occurred.
  248. *
  249. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  250. *
  251. * @thread_safety This function may be called from any thread. Access is not
  252. * synchronized.
  253. *
  254. * @since Added in version 3.0.
  255. *
  256. * @ingroup native
  257. */
  258. GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
  259. #endif
  260. #if defined(GLFW_EXPOSE_NATIVE_NSGL)
  261. /*! @brief Returns the `NSOpenGLContext` of the specified window.
  262. *
  263. * @return The `NSOpenGLContext` of the specified window, or `nil` if an
  264. * [error](@ref error_handling) occurred.
  265. *
  266. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  267. * GLFW_NOT_INITIALIZED.
  268. *
  269. * @thread_safety This function may be called from any thread. Access is not
  270. * synchronized.
  271. *
  272. * @since Added in version 3.0.
  273. *
  274. * @ingroup native
  275. */
  276. GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
  277. #endif
  278. #if defined(GLFW_EXPOSE_NATIVE_X11)
  279. /*! @brief Returns the `Display` used by GLFW.
  280. *
  281. * @return The `Display` used by GLFW, or `NULL` if an
  282. * [error](@ref error_handling) occurred.
  283. *
  284. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  285. *
  286. * @thread_safety This function may be called from any thread. Access is not
  287. * synchronized.
  288. *
  289. * @since Added in version 3.0.
  290. *
  291. * @ingroup native
  292. */
  293. GLFWAPI Display* glfwGetX11Display(void);
  294. /*! @brief Returns the `RRCrtc` of the specified monitor.
  295. *
  296. * @return The `RRCrtc` of the specified monitor, or `None` if an
  297. * [error](@ref error_handling) occurred.
  298. *
  299. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  300. *
  301. * @thread_safety This function may be called from any thread. Access is not
  302. * synchronized.
  303. *
  304. * @since Added in version 3.1.
  305. *
  306. * @ingroup native
  307. */
  308. GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
  309. /*! @brief Returns the `RROutput` of the specified monitor.
  310. *
  311. * @return The `RROutput` of the specified monitor, or `None` if an
  312. * [error](@ref error_handling) occurred.
  313. *
  314. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  315. *
  316. * @thread_safety This function may be called from any thread. Access is not
  317. * synchronized.
  318. *
  319. * @since Added in version 3.1.
  320. *
  321. * @ingroup native
  322. */
  323. GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
  324. /*! @brief Returns the `Window` of the specified window.
  325. *
  326. * @return The `Window` of the specified window, or `None` if an
  327. * [error](@ref error_handling) occurred.
  328. *
  329. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  330. *
  331. * @thread_safety This function may be called from any thread. Access is not
  332. * synchronized.
  333. *
  334. * @since Added in version 3.0.
  335. *
  336. * @ingroup native
  337. */
  338. GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
  339. /*! @brief Sets the current primary selection to the specified string.
  340. *
  341. * @param[in] string A UTF-8 encoded string.
  342. *
  343. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  344. * GLFW_PLATFORM_ERROR.
  345. *
  346. * @pointer_lifetime The specified string is copied before this function
  347. * returns.
  348. *
  349. * @thread_safety This function must only be called from the main thread.
  350. *
  351. * @sa @ref clipboard
  352. * @sa glfwGetX11SelectionString
  353. * @sa glfwSetClipboardString
  354. *
  355. * @since Added in version 3.3.
  356. *
  357. * @ingroup native
  358. */
  359. GLFWAPI void glfwSetX11SelectionString(const char* string);
  360. /*! @brief Returns the contents of the current primary selection as a string.
  361. *
  362. * If the selection is empty or if its contents cannot be converted, `NULL`
  363. * is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
  364. *
  365. * @return The contents of the selection as a UTF-8 encoded string, or `NULL`
  366. * if an [error](@ref error_handling) occurred.
  367. *
  368. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  369. * GLFW_PLATFORM_ERROR.
  370. *
  371. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  372. * should not free it yourself. It is valid until the next call to @ref
  373. * glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
  374. * library is terminated.
  375. *
  376. * @thread_safety This function must only be called from the main thread.
  377. *
  378. * @sa @ref clipboard
  379. * @sa glfwSetX11SelectionString
  380. * @sa glfwGetClipboardString
  381. *
  382. * @since Added in version 3.3.
  383. *
  384. * @ingroup native
  385. */
  386. GLFWAPI const char* glfwGetX11SelectionString(void);
  387. #endif
  388. #if defined(GLFW_EXPOSE_NATIVE_GLX)
  389. /*! @brief Returns the `GLXContext` of the specified window.
  390. *
  391. * @return The `GLXContext` of the specified window, or `NULL` if an
  392. * [error](@ref error_handling) occurred.
  393. *
  394. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  395. * GLFW_NOT_INITIALIZED.
  396. *
  397. * @thread_safety This function may be called from any thread. Access is not
  398. * synchronized.
  399. *
  400. * @since Added in version 3.0.
  401. *
  402. * @ingroup native
  403. */
  404. GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
  405. /*! @brief Returns the `GLXWindow` of the specified window.
  406. *
  407. * @return The `GLXWindow` of the specified window, or `None` if an
  408. * [error](@ref error_handling) occurred.
  409. *
  410. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  411. * GLFW_NOT_INITIALIZED.
  412. *
  413. * @thread_safety This function may be called from any thread. Access is not
  414. * synchronized.
  415. *
  416. * @since Added in version 3.2.
  417. *
  418. * @ingroup native
  419. */
  420. GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
  421. #endif
  422. #if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
  423. /*! @brief Returns the `struct wl_display*` used by GLFW.
  424. *
  425. * @return The `struct wl_display*` used by GLFW, or `NULL` if an
  426. * [error](@ref error_handling) occurred.
  427. *
  428. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  429. *
  430. * @thread_safety This function may be called from any thread. Access is not
  431. * synchronized.
  432. *
  433. * @since Added in version 3.2.
  434. *
  435. * @ingroup native
  436. */
  437. GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
  438. /*! @brief Returns the `struct wl_output*` of the specified monitor.
  439. *
  440. * @return The `struct wl_output*` of the specified monitor, or `NULL` if an
  441. * [error](@ref error_handling) occurred.
  442. *
  443. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  444. *
  445. * @thread_safety This function may be called from any thread. Access is not
  446. * synchronized.
  447. *
  448. * @since Added in version 3.2.
  449. *
  450. * @ingroup native
  451. */
  452. GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
  453. /*! @brief Returns the main `struct wl_surface*` of the specified window.
  454. *
  455. * @return The main `struct wl_surface*` of the specified window, or `NULL` if
  456. * an [error](@ref error_handling) occurred.
  457. *
  458. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  459. *
  460. * @thread_safety This function may be called from any thread. Access is not
  461. * synchronized.
  462. *
  463. * @since Added in version 3.2.
  464. *
  465. * @ingroup native
  466. */
  467. GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
  468. #endif
  469. #if defined(GLFW_EXPOSE_NATIVE_EGL)
  470. /*! @brief Returns the `EGLDisplay` used by GLFW.
  471. *
  472. * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
  473. * [error](@ref error_handling) occurred.
  474. *
  475. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  476. *
  477. * @remark Because EGL is initialized on demand, this function will return
  478. * `EGL_NO_DISPLAY` until the first context has been created via EGL.
  479. *
  480. * @thread_safety This function may be called from any thread. Access is not
  481. * synchronized.
  482. *
  483. * @since Added in version 3.0.
  484. *
  485. * @ingroup native
  486. */
  487. GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
  488. /*! @brief Returns the `EGLContext` of the specified window.
  489. *
  490. * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
  491. * [error](@ref error_handling) occurred.
  492. *
  493. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  494. * GLFW_NOT_INITIALIZED.
  495. *
  496. * @thread_safety This function may be called from any thread. Access is not
  497. * synchronized.
  498. *
  499. * @since Added in version 3.0.
  500. *
  501. * @ingroup native
  502. */
  503. GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
  504. /*! @brief Returns the `EGLSurface` of the specified window.
  505. *
  506. * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
  507. * [error](@ref error_handling) occurred.
  508. *
  509. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  510. * GLFW_NOT_INITIALIZED.
  511. *
  512. * @thread_safety This function may be called from any thread. Access is not
  513. * synchronized.
  514. *
  515. * @since Added in version 3.0.
  516. *
  517. * @ingroup native
  518. */
  519. GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
  520. #endif
  521. #if defined(GLFW_EXPOSE_NATIVE_OSMESA)
  522. /*! @brief Retrieves the color buffer associated with the specified window.
  523. *
  524. * @param[in] window The window whose color buffer to retrieve.
  525. * @param[out] width Where to store the width of the color buffer, or `NULL`.
  526. * @param[out] height Where to store the height of the color buffer, or `NULL`.
  527. * @param[out] format Where to store the OSMesa pixel format of the color
  528. * buffer, or `NULL`.
  529. * @param[out] buffer Where to store the address of the color buffer, or
  530. * `NULL`.
  531. * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
  532. * [error](@ref error_handling) occurred.
  533. *
  534. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  535. * GLFW_NOT_INITIALIZED.
  536. *
  537. * @thread_safety This function may be called from any thread. Access is not
  538. * synchronized.
  539. *
  540. * @since Added in version 3.3.
  541. *
  542. * @ingroup native
  543. */
  544. GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
  545. /*! @brief Retrieves the depth buffer associated with the specified window.
  546. *
  547. * @param[in] window The window whose depth buffer to retrieve.
  548. * @param[out] width Where to store the width of the depth buffer, or `NULL`.
  549. * @param[out] height Where to store the height of the depth buffer, or `NULL`.
  550. * @param[out] bytesPerValue Where to store the number of bytes per depth
  551. * buffer element, or `NULL`.
  552. * @param[out] buffer Where to store the address of the depth buffer, or
  553. * `NULL`.
  554. * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
  555. * [error](@ref error_handling) occurred.
  556. *
  557. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  558. * GLFW_NOT_INITIALIZED.
  559. *
  560. * @thread_safety This function may be called from any thread. Access is not
  561. * synchronized.
  562. *
  563. * @since Added in version 3.3.
  564. *
  565. * @ingroup native
  566. */
  567. GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
  568. /*! @brief Returns the `OSMesaContext` of the specified window.
  569. *
  570. * @return The `OSMesaContext` of the specified window, or `NULL` if an
  571. * [error](@ref error_handling) occurred.
  572. *
  573. * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
  574. * GLFW_NOT_INITIALIZED.
  575. *
  576. * @thread_safety This function may be called from any thread. Access is not
  577. * synchronized.
  578. *
  579. * @since Added in version 3.3.
  580. *
  581. * @ingroup native
  582. */
  583. GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
  584. #endif
  585. #ifdef __cplusplus
  586. }
  587. #endif
  588. #endif /* _glfw3_native_h_ */