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.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index d6002532d..88773a785 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -42,12 +42,13 @@
#include <os.h>
#include <colormapst.h>
+#include "privates.h"
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "glcontextmodes.h"
-static int glxScreenPrivateIndex;
+static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
const char GLServerVersion[] = "1.4";
static const char GLServerExtensions[] =
@@ -174,7 +175,7 @@ static char GLXServerExtensions[] =
"GLX_EXT_texture_from_pixmap "
"GLX_OML_swap_method "
"GLX_SGI_make_current_read "
-#ifndef __DARWIN__
+#ifndef __APPLE__
"GLX_SGIS_multisample "
"GLX_SGIX_hyperpipe "
"GLX_SGIX_swap_barrier "
@@ -269,7 +270,7 @@ glxCloseScreen (int index, ScreenPtr pScreen)
__GLXscreen *
glxGetScreen(ScreenPtr pScreen)
{
- return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
+ return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
}
void GlxSetVisualConfigs(int nconfigs,
@@ -497,19 +498,9 @@ void GlxSetVisualConfig(int config)
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
- static int glxGeneration;
__GLcontextModes *m;
int i;
- if (glxGeneration != serverGeneration)
- {
- glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (glxScreenPrivateIndex == -1)
- return;
-
- glxGeneration = serverGeneration;
- }
-
pGlxScreen->pScreen = pScreen;
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
@@ -548,9 +539,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
break;
}
- pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) pGlxScreen;
+ dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen);
}
-
+
void __glXScreenDestroy(__GLXscreen *screen)
{
xfree(screen->GLXvendor);