mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
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:
@@ -43,6 +43,7 @@
|
||||
|
||||
#define API_NAME_NATIVE "native"
|
||||
#define API_NAME_EGL "egl"
|
||||
#define API_NAME_OSMESA "osmesa"
|
||||
|
||||
#define PROFILE_NAME_CORE "core"
|
||||
#define PROFILE_NAME_COMPAT "compat"
|
||||
@@ -65,7 +66,8 @@ static void usage(void)
|
||||
BEHAVIOR_NAME_FLUSH ")\n");
|
||||
printf(" -c, --context-api=API the context creation API to use ("
|
||||
API_NAME_NATIVE " or "
|
||||
API_NAME_EGL ")\n");
|
||||
API_NAME_EGL " or "
|
||||
API_NAME_OSMESA ")\n");
|
||||
printf(" -d, --debug request a debug context\n");
|
||||
printf(" -f, --forward require a forward-compatible context\n");
|
||||
printf(" -h, --help show this help\n");
|
||||
@@ -452,6 +454,8 @@ int main(int argc, char** argv)
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API);
|
||||
else if (strcasecmp(optarg, API_NAME_EGL) == 0)
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
|
||||
else if (strcasecmp(optarg, API_NAME_OSMESA) == 0)
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_OSMESA_CONTEXT_API);
|
||||
else
|
||||
{
|
||||
usage();
|
||||
|
||||
Reference in New Issue
Block a user