mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +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
@@ -540,9 +540,6 @@ void _glfwSetGammaRampWin32(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
|
||||
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
assert(monitor != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
if (_glfw.platform.platformID != GLFW_PLATFORM_WIN32)
|
||||
@@ -551,14 +548,14 @@ GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* handle)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
assert(monitor != NULL);
|
||||
|
||||
return monitor->win32.publicAdapterName;
|
||||
}
|
||||
|
||||
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
assert(monitor != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
if (_glfw.platform.platformID != GLFW_PLATFORM_WIN32)
|
||||
@@ -567,6 +564,9 @@ GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* handle)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
assert(monitor != NULL);
|
||||
|
||||
return monitor->win32.publicDisplayName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user