summaryrefslogtreecommitdiff
path: root/src/glx/glxext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-07-28 10:07:52 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-07-28 16:42:00 -0400
commit6ddf66e9230ee862ac341c4767cf6b3b2dd2552b (patch)
tree6405435e3fdf6a0ea01db80b379b2d42c35eb3f8 /src/glx/glxext.c
parent4f9f066485d93cd6bb0e21fec0775ceed96d14de (diff)
glx: Rename __GLcontextModes to struct glx_config
With this rename, we use 'config' consitently to refer to GLX configurations instead of the modes/configs/visual mess before.
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r--src/glx/glxext.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 7612e5e834..8e8b362d10 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -208,14 +208,14 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
for (i = 0; i < screens; i++) {
psc = priv->screenConfigs[i];
if (psc->configs) {
- _gl_context_modes_destroy(psc->configs);
+ glx_config_destroy_list(psc->configs);
if (psc->effectiveGLXexts)
Xfree(psc->effectiveGLXexts);
psc->configs = NULL; /* NOTE: just for paranoia */
}
if (psc->visuals) {
- _gl_context_modes_destroy(psc->visuals);
- psc->visuals = NULL; /* NOTE: just for paranoia */
+ glx_config_destroy_list(psc->visuals);
+ psc->visuals = NULL; /* NOTE: just for paranoia */
}
Xfree((char *) psc->serverGLXexts);
@@ -349,12 +349,27 @@ enum {
};
+static GLint
+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
+ };
+
+ if (visualType < ARRAY_SIZE(glx_visual_types))
+ return glx_visual_types[visualType];
+
+ return GLX_NONE;
+}
+
/*
* getVisualConfigs uses the !tagged_only path.
* getFBConfigs uses the tagged_only path.
*/
_X_HIDDEN void
-__glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
+__glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
const INT32 * bp, Bool tagged_only,
Bool fbconfig_style_tags)
{
@@ -364,7 +379,7 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
/* Copy in the first set of properties */
config->visualID = *bp++;
- config->visualType = _gl_convert_from_x_visual_type(*bp++);
+ config->visualType = convert_from_x_visual_type(*bp++);
config->rgbMode = *bp++;
@@ -575,13 +590,13 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
(config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
}
-static __GLcontextModes *
+static struct glx_config *
createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
int screen, GLboolean tagged_only)
{
INT32 buf[__GLX_TOTAL_CONFIG], *props;
unsigned prop_size;
- __GLcontextModes *modes, *m;
+ struct glx_config *modes, *m;
int i;
if (nprops == 0)
@@ -594,7 +609,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
return NULL;
/* Allocate memory for our config structure */
- modes = _gl_context_modes_create(nvisuals, sizeof(__GLcontextModes));
+ modes = glx_config_create_list(nvisuals);
if (!modes)
return NULL;