mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 13:20:58 +00:00
wayland: Implement wl_surface retrieval from a GLFWwindow.
This commit is contained in:
parent
7935a366f4
commit
f2141bca35
@ -86,6 +86,8 @@ 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-protocol.h>
|
||||||
#else
|
#else
|
||||||
#error "No window API selected"
|
#error "No window API selected"
|
||||||
#endif
|
#endif
|
||||||
@ -301,6 +303,23 @@ 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_surface*` of the specified window.
|
||||||
|
*
|
||||||
|
* @return The `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* glfwGetWaylandSurface(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.
|
||||||
*
|
*
|
||||||
|
@ -529,3 +529,15 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
////// GLFW native API //////
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GLFWAPI struct wl_surface* glfwGetWaylandSurface(GLFWwindow* handle)
|
||||||
|
{
|
||||||
|
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||||
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
return window->wl.surface;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user