summaryrefslogtreecommitdiff
path: root/GL/glx/glxscreens.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-10-17 16:09:40 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-10-17 16:09:40 -0400
commit50b27e1ad2a98d36728dc8157492ef5c59c132cd (patch)
tree8a15db79b13cb377031eeb123c545d68254eaae5 /GL/glx/glxscreens.c
parentc3f7b862550fa8f46633162f83db8c27e46fc672 (diff)
downloadxserver-50b27e1ad2a98d36728dc8157492ef5c59c132cd.tar.gz
devPrivates rework: update new GL/glxext code.
Need to merge so this type of thing stops happening.
Diffstat (limited to 'GL/glx/glxscreens.c')
-rw-r--r--GL/glx/glxscreens.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index c6f060b3d..6e4d497f5 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -41,11 +41,12 @@
#include <windowstr.h>
#include <os.h>
+#include "privates.h"
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
-static int glxScreenPrivateIndex;
+static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
const char GLServerVersion[] = "1.4";
static const char GLServerExtensions[] =
@@ -278,22 +279,11 @@ glxCloseScreen (int index, ScreenPtr pScreen)
__GLXscreen *
glxGetScreen(ScreenPtr pScreen)
{
- return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
+ return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
}
void __glXScreenInit(__GLXscreen *glxScreen, ScreenPtr pScreen)
{
- static int glxGeneration;
-
- if (glxGeneration != serverGeneration)
- {
- glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (glxScreenPrivateIndex == -1)
- return;
-
- glxGeneration = serverGeneration;
- }
-
glxScreen->pScreen = pScreen;
glxScreen->GLextensions = xstrdup(GLServerExtensions);
glxScreen->GLXvendor = xstrdup(GLXServerVendorName);
@@ -308,9 +298,9 @@ void __glXScreenInit(__GLXscreen *glxScreen, ScreenPtr pScreen)
__glXScreenInitVisuals(glxScreen);
- pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) glxScreen;
+ dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, glxScreen);
}
-
+
void __glXScreenDestroy(__GLXscreen *screen)
{
xfree(screen->GLXvendor);