Win32: Add glfwAttachWin32Window

Related to #25.
This commit is contained in:
Camilla Löwy
2018-01-17 16:39:21 +01:00
parent 973bf29622
commit 4e96e90f64
6 changed files with 253 additions and 2 deletions

View File

@@ -172,6 +172,34 @@ GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
* @ingroup native
*/
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
/*! @brief Wraps an existing `HWND` in a new GLFW window object.
*
* This function creates a GLFW window object and its associated OpenGL or
* OpenGL ES context for an existing `HWND`. The `HWND` is not destroyed by
* GLFW.
*
* @param[in] handle The `HWND` to attach to the window object.
* @param[in] share The window whose context to share resources with, or `NULL`
* to not share resources.
* @return The handle of the created window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
* GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref window_creation
* @sa @ref glfwCreateWindow
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI GLFWwindow* glfwAttachWin32Window(HWND handle, GLFWwindow* share);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)