2
/* Copyright (c) Mark J. Kilgard, 1996. */
4
/* This program is freely distributable without licensing fees
5
and is provided without guarantee or warrantee expressed or
6
implied. This program is -not- in the public domain. */
12
int __glutMesaSwapHackSupport = 0; /* Not supported until
15
/* Use the "Mesa swap hack" if reasonable if and only if
16
MESA_SWAP_HACK is set to something whose first character is
17
not "N" or "n" AND "Brian Paul" is the vendor string AND
18
"Mesa X11"* (or "Mesa" for backward compatibility) is the
21
Anyone who modifies Mesa so that glXSwapBuffers does not
22
simply blit the previously rendered back buffer should
23
change either their vendor or renderer string to avoid
27
__glutDetermineMesaSwapHackSupport(void)
29
static int doneAlready = 0;
30
char *env, *vendor, *renderer;
34
env = getenv("MESA_SWAP_HACK");
36
if ((env[0] != 'n') && (env[0] != 'N')) {
37
vendor = (char *) glGetString(GL_VENDOR);
38
renderer = (char *) glGetString(GL_RENDERER);
40
/* Old versions of X11 Mesa uses the renderer string
41
"Mesa"; Brian plans to start using "Mesa X11" to
42
distinguish the X version of Mesa from other flavor
43
such as Windows or 3Dfx. */
45
#define MESA_X11 "Mesa X11"
47
/* XXX At some point in the future, eliminate the
48
backward compatibility for the old "Mesa" renderer
51
if (!strcmp(vendor, "Brian Paul") && (!strcmp(renderer, "Mesa") ||
52
!strncmp(renderer, MESA_X11, sizeof(MESA_X11) - 1)))
53
__glutMesaSwapHackSupport = 1;