mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 22:32:50 +00:00
Make native access functions verify context API
The native access functions for context handles did not verify that the context had been created with the same API the function was for. This makes these functions emit GLFW_NO_WINDOW_CONTEXT on API mismatch.
This commit is contained in:
+1
-1
@@ -358,7 +358,7 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* handle)
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(nil);
|
||||
|
||||
if (window->context.client == GLFW_NO_API)
|
||||
if (window->context.client != GLFW_NATIVE_CONTEXT_API)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
|
||||
return nil;
|
||||
|
||||
Reference in New Issue
Block a user