|
@@ -52,6 +52,8 @@ extern "C" {
|
|
* * `GLFW_EXPOSE_NATIVE_WIN32`
|
|
* * `GLFW_EXPOSE_NATIVE_WIN32`
|
|
* * `GLFW_EXPOSE_NATIVE_COCOA`
|
|
* * `GLFW_EXPOSE_NATIVE_COCOA`
|
|
* * `GLFW_EXPOSE_NATIVE_X11`
|
|
* * `GLFW_EXPOSE_NATIVE_X11`
|
|
|
|
+ * * `GLFW_EXPOSE_NATIVE_WAYLAND`
|
|
|
|
+ * * `GLFW_EXPOSE_NATIVE_MIR`
|
|
*
|
|
*
|
|
* The available context API macros are:
|
|
* The available context API macros are:
|
|
* * `GLFW_EXPOSE_NATIVE_WGL`
|
|
* * `GLFW_EXPOSE_NATIVE_WGL`
|
|
@@ -86,6 +88,10 @@ extern "C" {
|
|
#elif defined(GLFW_EXPOSE_NATIVE_X11)
|
|
#elif defined(GLFW_EXPOSE_NATIVE_X11)
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xlib.h>
|
|
#include <X11/extensions/Xrandr.h>
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
+#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
|
|
|
|
+ #include <wayland-client.h>
|
|
|
|
+#elif defined(GLFW_EXPOSE_NATIVE_MIR)
|
|
|
|
+ #include <mir_toolkit/mir_client_library.h>
|
|
#else
|
|
#else
|
|
#error "No window API selected"
|
|
#error "No window API selected"
|
|
#endif
|
|
#endif
|
|
@@ -301,6 +307,100 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
|
|
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
|
|
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
|
|
|
|
+/*! @brief Returns the `struct wl_display*` used by GLFW.
|
|
|
|
+ *
|
|
|
|
+ * @return The `struct wl_display*` used by GLFW, or `NULL` if an
|
|
|
|
+ * [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
|
|
|
|
+
|
|
|
|
+/*! @brief Returns the `struct wl_output*` of the specified monitor.
|
|
|
|
+ *
|
|
|
|
+ * @return The `struct wl_output*` of the specified monitor, or `NULL` if an
|
|
|
|
+ * [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
|
|
|
|
+
|
|
|
|
+/*! @brief Returns the main `struct wl_surface*` of the specified window.
|
|
|
|
+ *
|
|
|
|
+ * @return The main `struct wl_surface*` of the specified window, or `NULL` if
|
|
|
|
+ * an [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#if defined(GLFW_EXPOSE_NATIVE_MIR)
|
|
|
|
+/*! @brief Returns the `MirConnection*` used by GLFW.
|
|
|
|
+ *
|
|
|
|
+ * @return The `MirConnection*` used by GLFW, or `NULL` if an
|
|
|
|
+ * [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI MirConnection* glfwGetMirDisplay(void);
|
|
|
|
+
|
|
|
|
+/*! @brief Returns the Mir output ID of the specified monitor.
|
|
|
|
+ *
|
|
|
|
+ * @return The Mir output ID of the specified monitor, or zero if an
|
|
|
|
+ * [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI int glfwGetMirMonitor(GLFWmonitor* monitor);
|
|
|
|
+
|
|
|
|
+/*! @brief Returns the `MirSurface*` of the specified window.
|
|
|
|
+ *
|
|
|
|
+ * @return The `MirSurface*` of the specified window, or `NULL` if an
|
|
|
|
+ * [error](@ref error_handling) occurred.
|
|
|
|
+ *
|
|
|
|
+ * @par Thread Safety
|
|
|
|
+ * This function may be called from any thread. Access is not synchronized.
|
|
|
|
+ *
|
|
|
|
+ * @par History
|
|
|
|
+ * Added in GLFW 3.2.
|
|
|
|
+ *
|
|
|
|
+ * @ingroup native
|
|
|
|
+ */
|
|
|
|
+GLFWAPI MirSurface* glfwGetMirWindow(GLFWwindow* window);
|
|
|
|
+#endif
|
|
|
|
+
|
|
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
|
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
|
/*! @brief Returns the `EGLDisplay` used by GLFW.
|
|
/*! @brief Returns the `EGLDisplay` used by GLFW.
|
|
*
|
|
*
|