diff options
author | faith <faith> | 2000-10-31 11:10:29 +0000 |
---|---|---|
committer | faith <faith> | 2000-10-31 11:10:29 +0000 |
commit | f559d00254d4e731b75f4e4e0a1700041d77842c (patch) | |
tree | 4d13594ad5acf5200c8b4bcd5079442b53db19d9 | |
parent | b4acffe6720b1e55d3ebebcb8e1f45f8ec9b8792 (diff) |
Change to LIBGL_DRI_AUTOFULLSCREEN
Make LIBGL_DRI_AUTOFULLSCREEN be enableable and disableable when set
Still need to remove debugging information from:
xc/lib/GL/mesa/dri/dri_mesa.c
xc/lib/GL/dri/XF86dri.c
xc/programs/Xserver/GL/dri/dri.c (near FIXME and in *FullScreen)
-rw-r--r-- | xc/lib/GL/mesa/dri/dri_mesa.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/xc/lib/GL/mesa/dri/dri_mesa.c b/xc/lib/GL/mesa/dri/dri_mesa.c index ce19ff62b..070ee633a 100644 --- a/xc/lib/GL/mesa/dri/dri_mesa.c +++ b/xc/lib/GL/mesa/dri/dri_mesa.c @@ -71,6 +71,21 @@ static void *driMesaCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config); static void driMesaDestroyScreen(Display *dpy, int scrn, void *private); +static Bool driFeatureOn(const char *name) +{ + char *env = getenv(name); + + if (!env) return GL_FALSE; + if (!strcasecmp(env, "enable")) return GL_TRUE; + if (!strcasecmp(env, "1")) return GL_TRUE; + if (!strcasecmp(env, "on")) return GL_TRUE; + if (!strcasecmp(env, "true")) return GL_TRUE; + if (!strcasecmp(env, "t")) return GL_TRUE; + if (!strcasecmp(env, "yes")) return GL_TRUE; + if (!strcasecmp(env, "y")) return GL_TRUE; + + return GL_FALSE; +} /* @@ -238,6 +253,8 @@ static Bool driMesaBindContext(Display *dpy, int scrn, __DRIdrawablePrivate *pdp; __DRIscreenPrivate *psp; __DRIcontextPrivate *pcp; + static Bool envchecked = False; + static Bool checkfullscreen = False; /* ** Assume error checking is done properly in glXMakeCurrent before @@ -306,7 +323,11 @@ static Bool driMesaBindContext(Display *dpy, int scrn, /* Check for the potential to enter an automatic full-screen mode. This may need to be moved up. */ - if (getenv("LIBGL_DRI_FULLSCREEN") && pdp->numClipRects == 1) { + if (!envchecked) { + checkfullscreen = driFeatureOn("LIBGL_DRI_AUTOFULLSCREEN"); + envchecked = GL_TRUE; + } + if (checkfullscreen && pdp->numClipRects == 1) { /* If there is valid information in the SAREA, we can use it to avoid a protocol request. The only time when the SAREA information won't be valid will be initially, so in the worst |