mirror of
https://github.com/glfw/glfw.git
synced 2024-11-24 21:54:35 +00:00
Add assertions for context function invariants
Related to #2327
(cherry picked from commit 93d70cb6a8
)
This commit is contained in:
parent
cb0dafa7c0
commit
c98860db9e
@ -304,6 +304,7 @@ static int extensionSupportedEGL(const char* extension)
|
||||
static GLFWglproc getProcAddressEGL(const char* procname)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
assert(window != NULL);
|
||||
|
||||
if (window->context.egl.client)
|
||||
{
|
||||
|
@ -190,6 +190,7 @@ static void swapBuffersGLX(_GLFWwindow* window)
|
||||
static void swapIntervalGLX(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
assert(window != NULL);
|
||||
|
||||
if (_glfw.glx.EXT_swap_control)
|
||||
{
|
||||
|
@ -81,11 +81,10 @@ static void swapIntervalNSGL(int interval)
|
||||
@autoreleasepool {
|
||||
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
if (window)
|
||||
{
|
||||
[window->context.nsgl.object setValues:&interval
|
||||
forParameter:NSOpenGLContextParameterSwapInterval];
|
||||
}
|
||||
assert(window != NULL);
|
||||
|
||||
[window->context.nsgl.object setValues:&interval
|
||||
forParameter:NSOpenGLContextParameterSwapInterval];
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
@ -333,6 +333,7 @@ static void swapBuffersWGL(_GLFWwindow* window)
|
||||
static void swapIntervalWGL(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
assert(window != NULL);
|
||||
|
||||
window->context.wgl.interval = interval;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user