mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Added native monitor handle access to native API.
This commit is contained in:
parent
2733cce8ff
commit
16eb97dbc3
@ -45,6 +45,7 @@ The following dependencies are needed by the examples and test programs:
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
- Added native monitor handle access to native API
|
||||||
- [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen
|
- [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen
|
||||||
recorders to fail
|
recorders to fail
|
||||||
|
|
||||||
|
@ -102,6 +102,11 @@ extern "C" {
|
|||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||||
|
/*! @brief Returns the device name of the specified monitor.
|
||||||
|
* @return The the device name of the specified monitor.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI const WCHAR* glfwGetWin32Monitor(GLFWmonitor* monitor);
|
||||||
/*! @brief Returns the `HWND` of the specified window.
|
/*! @brief Returns the `HWND` of the specified window.
|
||||||
* @return The `HWND` of the specified window.
|
* @return The `HWND` of the specified window.
|
||||||
* @ingroup native
|
* @ingroup native
|
||||||
@ -118,6 +123,11 @@ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||||
|
/*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
|
||||||
|
* @return The the `CGDirectDisplayID` of the specified monitor.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
|
||||||
/*! @brief Returns the `NSWindow` of the specified window.
|
/*! @brief Returns the `NSWindow` of the specified window.
|
||||||
* @return The `NSWindow` of the specified window.
|
* @return The `NSWindow` of the specified window.
|
||||||
* @ingroup native
|
* @ingroup native
|
||||||
@ -139,6 +149,11 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
|
|||||||
* @ingroup native
|
* @ingroup native
|
||||||
*/
|
*/
|
||||||
GLFWAPI Display* glfwGetX11Display(void);
|
GLFWAPI Display* glfwGetX11Display(void);
|
||||||
|
/*! @brief Returns the `RRCrtc` of the specified monitor.
|
||||||
|
* @return The the `RRCrtc` of the specified monitor.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI RRCrtc glfwGetX11Monitor(GLFWmonitor* monitor);
|
||||||
/*! @brief Returns the `Window` of the specified window.
|
/*! @brief Returns the `Window` of the specified window.
|
||||||
* @return The `Window` of the specified window.
|
* @return The `Window` of the specified window.
|
||||||
* @ingroup native
|
* @ingroup native
|
||||||
|
@ -386,3 +386,15 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
|||||||
CVDisplayLinkRelease(link);
|
CVDisplayLinkRelease(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
////// GLFW native API //////
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle)
|
||||||
|
{
|
||||||
|
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||||
|
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
||||||
|
return monitor->ns.displayID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -282,3 +282,15 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
|
|||||||
&mode->blueBits);
|
&mode->blueBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
////// GLFW native API //////
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GLFWAPI const WCHAR* glfwGetWin32Monitor(GLFWmonitor* handle)
|
||||||
|
{
|
||||||
|
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||||
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
return monitor->win32.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -402,3 +402,15 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
|
|||||||
&mode->redBits, &mode->greenBits, &mode->blueBits);
|
&mode->redBits, &mode->greenBits, &mode->blueBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
////// GLFW native API //////
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GLFWAPI RRCrtc glfwGetX11Monitor(GLFWmonitor* handle)
|
||||||
|
{
|
||||||
|
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||||
|
_GLFW_REQUIRE_INIT_OR_RETURN(None);
|
||||||
|
return monitor->x11.crtc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user