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:
Camilla Löwy
2021-10-04 20:32:32 +02:00
parent 0391b7b277
commit cca9008db2
6 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -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;