* Mesa 3-D graphics library
* Version: 6.3
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
static XMesaVisual
-choose_visual( Display *dpy, int screen, const int *list,
- GLboolean rgbModeDefault )
+choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
{
+ const GLboolean rgbModeDefault = fbConfig;
const int *parselist;
XVisualInfo *vis;
int min_ci = 0;
switch (*parselist) {
case GLX_USE_GL:
- /* ignore */
- parselist++;
+ if (fbConfig) {
+ /* invalid token */
+ return NULL;
+ }
+ else {
+ /* skip */
+ parselist++;
+ }
break;
case GLX_BUFFER_SIZE:
parselist++;
level = *parselist++;
break;
case GLX_RGBA:
- rgb_flag = GL_TRUE;
- parselist++;
+ if (fbConfig) {
+ /* invalid token */
+ return NULL;
+ }
+ else {
+ rgb_flag = GL_TRUE;
+ parselist++;
+ }
break;
case GLX_DOUBLEBUFFER:
- double_flag = GL_TRUE;
- parselist++;
+ parselist++;
+ if (fbConfig) {
+ double_flag = *parselist++;
+ }
+ else {
+ double_flag = GL_TRUE;
+ }
break;
case GLX_STEREO:
- stereo_flag = GL_TRUE;
- return NULL;
+ parselist++;
+ if (fbConfig) {
+ stereo_flag = *parselist++;
+ }
+ else {
+ stereo_flag = GL_TRUE;
+ }
+ return NULL; /* stereo not supported */
case GLX_AUX_BUFFERS:
- /* ignore */
parselist++;
numAux = *parselist++;
if (numAux > MAX_AUX_BUFFERS)
ASSERT(xmvis);
switch(attrib) {
case GLX_USE_GL:
+ if (fbconfig)
+ return GLX_BAD_ATTRIBUTE;
*value = (int) True;
return 0;
case GLX_BUFFER_SIZE:
*value = xmvis->mesa_visual.level;
return 0;
case GLX_RGBA:
+ if (fbconfig)
+ return GLX_BAD_ATTRIBUTE;
if (xmvis->mesa_visual.rgbMode) {
*value = True;
}