Cocoa: Added glfwGetCocoaView native access function

Resolves #2235

Co-authored-by: mightgoyardstill <mightgoyardstill@users.noreply.github.com>
This commit is contained in:
Doug Binks
2024-02-20 13:20:30 +00:00
parent 0bb605cd79
commit 1fb7f0e120
5 changed files with 40 additions and 0 deletions
+15
View File
@@ -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