mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 20:22:15 +00:00
Win32: Expose native HDC with glfwGetWGLContextDC
This commit is contained in:
parent
114776a246
commit
bbf1a617b0
@ -185,6 +185,20 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
|
||||
|
||||
/*! @brief Returns the `HDC` of the specified window.
|
||||
*
|
||||
* @return The `HDC` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.TODO.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HDC glfwGetWGLContextDC(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
|
@ -796,3 +796,16 @@ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* handle)
|
||||
return window->context.wgl.handle;
|
||||
}
|
||||
|
||||
GLFWAPI HDC glfwGetWGLContextDC(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
if (window->context.client == GLFW_NO_API)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return window->context.wgl.dc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user