Add GLFW_OSMESA_CONTEXT_API

This allows the creation of OpenGL contexts via OSMesa on existing
platforms.  It does not add a compile- or link-time dependency on
OSMesa.

Fixes #281.
This commit is contained in:
Camilla Löwy
2017-02-28 19:23:25 +01:00
parent a44f2c0e65
commit e9560ef021
18 changed files with 96 additions and 39 deletions
+8 -1
View File
@@ -1084,13 +1084,20 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (!_glfwCreateContextWGL(window, ctxconfig, fbconfig))
return GLFW_FALSE;
}
else
else if (ctxconfig->source == GLFW_EGL_CONTEXT_API)
{
if (!_glfwInitEGL())
return GLFW_FALSE;
if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig))
return GLFW_FALSE;
}
else if (ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
{
if (!_glfwInitOSMesa())
return GLFW_FALSE;
if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
return GLFW_FALSE;
}
}
if (window->monitor)