summaryrefslogtreecommitdiff
path: root/GL/glx/glxscreens.c
diff options
context:
space:
mode:
Diffstat (limited to 'GL/glx/glxscreens.c')
-rw-r--r--GL/glx/glxscreens.c93
1 files changed, 9 insertions, 84 deletions
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index aea774105..04882098a 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.10 2002/04/04 14:05:36 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.11 2003/06/23 17:35:44 eich Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -46,11 +46,13 @@
#include "glxserver.h"
#include "glxutil.h"
+const char GLServerVersion[] = "1.2";
static const char GLServerExtensions[] =
"GL_ARB_depth_texture "
"GL_ARB_imaging "
"GL_ARB_multitexture "
"GL_ARB_point_parameters "
+ "GL_ARB_point_sprite "
"GL_ARB_shadow "
"GL_ARB_shadow_ambient "
"GL_ARB_texture_border_clamp "
@@ -108,6 +110,7 @@ static const char GLServerExtensions[] =
"GL_MESA_pack_invert "
"GL_MESA_ycbcr_texture "
"GL_NV_blend_square "
+ "GL_NV_point_sprite "
"GL_NV_texgen_reflection "
"GL_NV_texture_rectangle "
"GL_SGIS_generate_mipmap "
@@ -125,11 +128,15 @@ static const char GLServerExtensions[] =
*/
static char GLXServerVendorName[] = "SGI";
static char GLXServerVersion[] = "1.2";
-static char GLXServerExtensions[] =
+static char GLXServerExtensions[] =
+ "GLX_ARB_multisample "
"GLX_EXT_visual_info "
"GLX_EXT_visual_rating "
"GLX_EXT_import_context "
+ "GLX_OML_swap_method "
"GLX_SGI_make_current_read "
+ "GLX_SGIS_multisample "
+ "GLX_SGIX_fbconfig "
;
/*
@@ -149,81 +156,6 @@ GLint __glXNumActiveScreens;
RESTYPE __glXDrawableRes;
-#if 0
-static int
-CountBits(unsigned long mask)
-{
- int count = 0;
-
- while(mask) {
- count += (mask&1);
- mask >>= 1;
- }
-
- return count;
-}
-#endif
-
-#if 0
-/*
-** A typical implementation would not probably not run through the screen's
-** visuals to find ones that match the visual configs supplied by the DDX
-** Sample OpenGL as we do here; we have done this to make this code easy to
-** drop into an existing X server.
-*/
-static int matchVisuals(__GLXvisualConfig *pGlxVisual, int numVisuals,
- int screen)
-{
- int i, j;
- __GLXvisualConfig *pvis = pGlxVisual;
- ScreenPtr pScreen = screenInfo.screens[screen];
- VisualPtr pVisual;
- int numMatchingVisuals = 0;
- int *used;
-
- used = (int *)__glXMalloc(pScreen->numVisuals*sizeof(int));
- __glXMemset(used, 0, pScreen->numVisuals*sizeof(int));
-
- for (i=0; i < numVisuals; i++, pvis++) {
- /*
- ** Look through all the server's visuals to see which match.
- */
- pvis->vid = 0;
- pVisual = pScreen->visuals;
- for (j=0; j < pScreen->numVisuals; j++, pVisual++) {
- if (pvis->class == pVisual->class &&
- pvis->bufferSize == pVisual->nplanes &&
- !used[j]) {
- int rBits, gBits, bBits, aBits;
-
- /* count bits per rgb */
- rBits = CountBits(pVisual->redMask);
- gBits = CountBits(pVisual->greenMask);
- bBits = CountBits(pVisual->blueMask);
- aBits = 0;
- if ((pvis->redSize == rBits) &&
- (pvis->greenSize == gBits) &&
- (pvis->blueSize == bBits) &&
- (pvis->alphaSize == aBits)) {
- /*
- ** We'll consider this a match.
- */
- pvis->vid = pVisual->vid;
- pvis->redMask = pVisual->redMask;
- pvis->greenMask = pVisual->greenMask;
- pvis->blueMask = pVisual->blueMask;
- pvis->alphaMask = 0;
- numMatchingVisuals++;
- used[j] = 1;
- break;
- }
- }
- }
- }
- __glXFree(used);
- return numMatchingVisuals;
-}
-#endif
/*
** Destroy routine that gets called when a drawable is freed. A drawable
@@ -353,14 +285,7 @@ void __glXScreenInit(GLint numscreens)
if ((*__glXScreens[j]->screenProbe)(i)) {
__glXActiveScreens[i] = *__glXScreens[j];
-#if 0
- /* we don't use this since matchVisuals doesn't allow alpha */
- __glXActiveScreens[i].numUsableVisuals =
- matchVisuals(__glXActiveScreens[i].pGlxVisual,
- __glXActiveScreens[i].numVisuals, i);
-#else
__glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
-#endif
__glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
__glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
__glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);