mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Add GLFW_NO_API for creating context-less windows
This commit is contained in:
+7
-5
@@ -887,10 +887,11 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!createWindow(window, wndconfig))
|
||||
return GLFW_FALSE;
|
||||
|
||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||
return GLFW_FALSE;
|
||||
|
||||
[window->nsgl.context setView:window->ns.view];
|
||||
if (ctxconfig->api != GLFW_NO_API)
|
||||
{
|
||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
if (wndconfig->monitor)
|
||||
{
|
||||
@@ -909,7 +910,8 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
if (window->monitor)
|
||||
leaveFullscreenMode(window);
|
||||
|
||||
_glfwDestroyContext(window);
|
||||
if (window->context.api != GLFW_NO_API)
|
||||
_glfwDestroyContext(window);
|
||||
|
||||
[window->ns.object setDelegate:nil];
|
||||
[window->ns.delegate release];
|
||||
|
||||
Reference in New Issue
Block a user