mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 14:45:46 +00:00
Cocoa: Added glfwGetCocoaView native access function
Resolves #2235 Co-authored-by: mightgoyardstill <mightgoyardstill@users.noreply.github.com>
This commit is contained in:
@@ -2053,5 +2053,20 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)
|
||||
return window->ns.object;
|
||||
}
|
||||
|
||||
GLFWAPI id glfwGetCocoaView(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(nil);
|
||||
|
||||
if (_glfw.platform.platformID != GLFW_PLATFORM_COCOA)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_UNAVAILABLE,
|
||||
"Cocoa: Platform not initialized");
|
||||
return nil;
|
||||
}
|
||||
|
||||
return window->ns.view;
|
||||
}
|
||||
|
||||
#endif // _GLFW_COCOA
|
||||
|
||||
|
||||
Reference in New Issue
Block a user