mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 22:32:50 +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:
+4
-4
@@ -615,11 +615,11 @@ GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions
|
||||
|
||||
GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
|
||||
{
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFWwindow* previous;
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
previous = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
|
||||
if (window && window->context.client == GLFW_NO_API)
|
||||
@@ -647,11 +647,11 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
|
||||
|
||||
GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
|
||||
{
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
if (window->context.client == GLFW_NO_API)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_WINDOW_CONTEXT,
|
||||
|
||||
Reference in New Issue
Block a user