mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 00:49:48 +00:00
Place assertions for handles after init check
This lets automated testing check that GLFW_NOT_INITIALIZED is emitted for every public function.
This commit is contained in:
+6
-6
@@ -2041,9 +2041,6 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
|
||||
|
||||
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(nil);
|
||||
|
||||
if (_glfw.platform.platformID != GLFW_PLATFORM_COCOA)
|
||||
@@ -2053,14 +2050,14 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)
|
||||
return nil;
|
||||
}
|
||||
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
return window->ns.object;
|
||||
}
|
||||
|
||||
GLFWAPI id glfwGetCocoaView(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(nil);
|
||||
|
||||
if (_glfw.platform.platformID != GLFW_PLATFORM_COCOA)
|
||||
@@ -2070,6 +2067,9 @@ GLFWAPI id glfwGetCocoaView(GLFWwindow* handle)
|
||||
return nil;
|
||||
}
|
||||
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
return window->ns.view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user