diff options
Diffstat (limited to 'GL/glx/glxscreens.c')
-rw-r--r-- | GL/glx/glxscreens.c | 20 |
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); |