aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-09-08 11:52:01 +0100
committerEric Engestrom <[email protected]>2017-09-12 13:53:11 +0100
commit5c68ea29f31283768c8e1b631eb812d1e74cb5c3 (patch)
treef37325b713cf841ac49ea6e0cb372b5619473d1d /src/glx
parentf4a9d205d8a6474defa86dc4f12b7e63e61a49d9 (diff)
egl+glx: turn LIBGL_ALWAYS_SOFTWARE into a boolean
Instead of setting based on set/unset, allow users to use boolean values. In the docs, use `ALWAYS=true` instead of `ALWAYS=1` as it's clearer IMO. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/apple/apple_visual.c2
-rw-r--r--src/glx/glxext.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
index d665cd7e01c..a4918239178 100644
--- a/src/glx/apple/apple_visual.c
+++ b/src/glx/apple/apple_visual.c
@@ -90,7 +90,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
attr[numattr++] = kCGLPFAOffScreen;
}
- else if (getenv("LIBGL_ALWAYS_SOFTWARE") != NULL) {
+ else if (env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
apple_glx_diagnostic
("Software rendering requested. Using kCGLRendererGenericFloatID.\n");
attr[numattr++] = kCGLPFARendererID;
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 3431f3e5cae..cd9a3ba6ba0 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -908,7 +908,7 @@ __glXInitialize(Display * dpy)
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
- glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
+ glx_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
dpyPriv->drawHash = __glxHashCreate();