*/
#include <assert.h>
+#include <stdbool.h>
+
#include "glxclient.h"
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#endif
#include "glxextensions.h"
+#include "util/debug.h"
+
#include <X11/Xlib-xcb.h>
#include <xcb/xcb.h>
#include <xcb/glx.h>
convert_from_x_visual_type(int visualType)
{
static const int glx_visual_types[] = {
- GLX_STATIC_GRAY, GLX_GRAY_SCALE,
- GLX_STATIC_COLOR, GLX_PSEUDO_COLOR,
- GLX_TRUE_COLOR, GLX_DIRECT_COLOR
+ [StaticGray] = GLX_STATIC_GRAY,
+ [GrayScale] = GLX_GRAY_SCALE,
+ [StaticColor] = GLX_STATIC_COLOR,
+ [PseudoColor] = GLX_PSEUDO_COLOR,
+ [TrueColor] = GLX_TRUE_COLOR,
+ [DirectColor] = GLX_DIRECT_COLOR,
};
if (visualType < ARRAY_SIZE(glx_visual_types))
#endif
}
- config->sRGBCapable = GL_FALSE;
-
/*
** Additional properties may be in a list at the end
** of the reply. They are in pairs of property type
i = count;
break;
default:
- if(getenv("LIBGL_DIAGNOSTIC")) {
+ if(env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
long int tagvalue = *bp++;
fprintf(stderr, "WARNING: unknown GLX tag from server: "
"tag 0x%lx value 0x%lx\n", tag, tagvalue);
*/
m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
#endif
+ /* Older X servers don't send this so we default it here. */
+ m->sRGBCapable = GL_FALSE;
__glXInitializeVisualConfigFromTags(m, nprops, props,
tagged_only, GL_TRUE);
m->screen = screen;
dpyPriv->glXDrawHash = __glxHashCreate();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
- glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
+ glx_direct = !env_var_as_boolean("LIBGL_ALWAYS_INDIRECT", false);
+ glx_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
dpyPriv->drawHash = __glxHashCreate();
#if defined(GLX_USE_DRM)
if (glx_direct && glx_accel) {
#if defined(HAVE_DRI3)
- if (!getenv("LIBGL_DRI3_DISABLE"))
+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
dpyPriv->dri3Display = dri3_create_display(dpy);
#endif /* HAVE_DRI3 */
dpyPriv->dri2Display = dri2CreateDisplay(dpy);