aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/GL
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/GL')
-rw-r--r--nx-X11/programs/Xserver/GL/Imakefile66
-rw-r--r--nx-X11/programs/Xserver/GL/apple/Imakefile49
-rw-r--r--nx-X11/programs/Xserver/GL/apple/aglGlx.c1355
-rw-r--r--nx-X11/programs/Xserver/GL/apple/indirect.c1380
-rw-r--r--nx-X11/programs/Xserver/GL/dri/Imakefile35
-rw-r--r--nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference35
-rw-r--r--nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference34
-rw-r--r--nx-X11/programs/Xserver/GL/dri/dri-def.cpp50
-rw-r--r--nx-X11/programs/Xserver/GL/dri/dri.c2109
-rw-r--r--nx-X11/programs/Xserver/GL/dri/dri.h345
-rw-r--r--nx-X11/programs/Xserver/GL/dri/drimodule.c127
-rw-r--r--nx-X11/programs/Xserver/GL/dri/dristruct.h105
-rw-r--r--nx-X11/programs/Xserver/GL/dri/sarea.h94
-rw-r--r--nx-X11/programs/Xserver/GL/dri/xf86dri.c649
-rw-r--r--nx-X11/programs/Xserver/GL/glx/Imakefile118
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_disptab.c839
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_disptab.h652
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c4447
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h159
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_render.c2282
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_renderswap.c3387
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_single.c1787
-rw-r--r--nx-X11/programs/Xserver/GL/glx/g_singleswap.c2208
-rw-r--r--nx-X11/programs/Xserver/GL/glx/global.c76
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glx-def.cpp662
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxbuf.c296
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxbuf.h57
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxcmds.c2156
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c871
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxcontext.h164
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxdrawable.h112
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxerror.h58
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxext.c505
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxext.h131
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxfb.c183
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxfb.h52
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glximports.c184
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glximports.h66
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxmem.c151
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxmem.h48
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxpix.c132
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxpix.h48
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxscreens.c378
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxscreens.h103
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxserver.h287
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxutil.c507
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxutil.h84
-rw-r--r--nx-X11/programs/Xserver/GL/glx/impsize.h56
-rw-r--r--nx-X11/programs/Xserver/GL/glx/module/Imakefile4
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2.c271
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2.c.NX.original271
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2.c.X.original271
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2swap.c393
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original393
-rw-r--r--nx-X11/programs/Xserver/GL/glx/render2swap.c.X.original393
-rw-r--r--nx-X11/programs/Xserver/GL/glx/renderpix.c312
-rw-r--r--nx-X11/programs/Xserver/GL/glx/renderpixswap.c555
-rw-r--r--nx-X11/programs/Xserver/GL/glx/rensize.c987
-rw-r--r--nx-X11/programs/Xserver/GL/glx/rensizetab.c2448
-rw-r--r--nx-X11/programs/Xserver/GL/glx/single2.c411
-rw-r--r--nx-X11/programs/Xserver/GL/glx/single2swap.c303
-rw-r--r--nx-X11/programs/Xserver/GL/glx/singlepix.c462
-rw-r--r--nx-X11/programs/Xserver/GL/glx/singlepixswap.c518
-rw-r--r--nx-X11/programs/Xserver/GL/glx/singlesize.c1222
-rw-r--r--nx-X11/programs/Xserver/GL/glx/singlesize.h87
-rw-r--r--nx-X11/programs/Xserver/GL/glx/unpack.h240
-rw-r--r--nx-X11/programs/Xserver/GL/glx/xfont.c195
-rw-r--r--nx-X11/programs/Xserver/GL/glxmodule.c1270
-rw-r--r--nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h115
-rw-r--r--nx-X11/programs/Xserver/GL/include/GL/xf86glx.h43
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp1462
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c64
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile77
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile53
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/Imakefile47
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/Imakefile93
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/Imakefile.NX.original93
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original93
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c952
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original952
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original914
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c151
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h106
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h102
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile56
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/main/Imakefile61
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original61
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original61
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/math/Imakefile55
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/shader/Imakefile59
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile54
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile59
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile46
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile63
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile55
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile66
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/GL/opengl/Imakefile140
-rw-r--r--nx-X11/programs/Xserver/GL/windows/ChangeLog64
-rwxr-xr-xnx-X11/programs/Xserver/GL/windows/Imakefile36
-rw-r--r--nx-X11/programs/Xserver/GL/windows/glwindows.h64
-rwxr-xr-xnx-X11/programs/Xserver/GL/windows/glwrap.c583
-rwxr-xr-xnx-X11/programs/Xserver/GL/windows/indirect.c1605
109 files changed, 49232 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/GL/Imakefile b/nx-X11/programs/Xserver/GL/Imakefile
new file mode 100644
index 000000000..47134e0a1
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/Imakefile
@@ -0,0 +1,66 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/Imakefile,v 1.12 2003/08/06 14:04:01 eich Exp $
+
+#define IHaveModules
+#include <Server.tmpl>
+
+#define IHaveSubdirs
+
+#if GlxUseSGISI
+ CORE_SUBDIR = /* opengl */
+#elif defined(DarwinArchitecture) && DarwinQuartzSupport
+ CORE_SUBDIR = apple mesa
+#elif defined(cygwinArchitecture) && GlxUseWindows
+ CORE_SUBDIR = windows mesa
+#elif defined(Win32Architecture) && GlxUseWindows
+ CORE_SUBDIR = windows
+#else
+ CORE_SUBDIR = mesa
+#endif
+
+#if BuildXF86DRI && ((defined(XF86Server) && XF86Server) \
+ || (defined(XorgServer) && XorgServer))
+DRI_SUBDIR = dri
+#endif
+
+SUBDIRS = glx $(DRI_SUBDIR) $(CORE_SUBDIR)
+
+#if DoLoadableServer
+MSRCS = glxmodule.c
+MOBJS = glxmodule.o
+#endif
+
+#if BuildModuleInSubdir
+SRCS = glx/module/?*.c $(MSRCS)
+OBJS = glx/module/?*.o $(MOBJS)
+#else
+SRCS = glx/?*.c $(MSRCS)
+OBJS = glx/?*.o $(MOBJS)
+#endif
+
+DONES = glx/DONE
+
+INCLUDES = -Iinclude -Idri -I$(SERVERSRC)/include -I$(SERVERSRC)/mi \
+ -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(XF86OSSRC)
+DEPEND_DEFINES = $(EXT_DEFINES) DependDefines
+DEFINES = $(GLX_DEFINES)
+
+#if HasParallelMake
+MakeMutex($(SUBDIRS) $(OBJS) $(DONES))
+#endif
+
+#if HasGnuMake || HasBsdMake
+$(DONES): $(SUBDIRS)
+#endif
+
+ModuleObjectRule()
+
+DepLibraryModuleTarget(glx,$(SUBDIRS) $(DONES) $(MOBJS),$(OBJS))
+
+InstallLibraryModule(glx,$(MODULEDIR),extensions)
+ForceSubdirs($(SUBDIRS))
+
+DependSubdirs($(SUBDIRS))
+MakeLintLibSubdirs($(SUBDIRS))
+LintSubdirs($(SUBDIRS))
+
+InstallDriverSDKLibraryModule(glx,$(DRIVERSDKMODULEDIR),extensions)
diff --git a/nx-X11/programs/Xserver/GL/apple/Imakefile b/nx-X11/programs/Xserver/GL/apple/Imakefile
new file mode 100644
index 000000000..36b780c73
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/apple/Imakefile
@@ -0,0 +1,49 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/apple/Imakefile,v 1.2 2003/09/16 00:36:11 torrey Exp $
+
+#include <Server.tmpl>
+
+ XPRDIR = $(SERVERSRC)/hw/darwin/quartz/xpr
+
+LinkSourceFile(x-list.c,$(XPRDIR))
+LinkSourceFile(x-list.h,$(XPRDIR))
+LinkSourceFile(x-hash.c,$(XPRDIR))
+LinkSourceFile(x-hash.h,$(XPRDIR))
+LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
+
+ BASE_SRCS = compsize.c
+ BASE_OBJS = compsize.o
+
+ AGL_SRCS = aglGlx.c
+ AGL_OBJS = aglGlx.o
+
+#if HasXplugin
+ GL_SRCS = indirect.c x-hash.c x-list.c
+ GL_OBJS = indirect.o x-hash.o x-list.o
+
+ AS = /System/Library/Frameworks/ApplicationServices.framework
+
+ GL_INCLUDES = -I$(LIBSRC)/GL/apple -I$(XPRDIR) -I$(XPINCDIR) \
+ -F$(AS)/Frameworks
+#endif
+
+ SRCS = $(BASE_SRCS) $(AGL_SRCS) $(GL_SRCS)
+ OBJS = $(BASE_OBJS) $(AGL_OBJS) $(GL_OBJS)
+
+ INCLUDES = -I. -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
+ -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(FONTINCSRC) \
+ -I$(SERVERSRC)/render -I$(SERVERSRC)/GL/include \
+ -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/hw/darwin/quartz/cr \
+ -I$(SERVERSRC)/hw/darwin/quartz $(GL_INCLUDES) \
+ -I$(MESASRCDIR)/include -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(XF86OSSRC)
+
+ DEFINES = $(GLX_DEFINES)
+
+NormalLibraryTarget(AGLcore,$(AGL_OBJS) $(BASE_OBJS))
+#if HasXplugin
+NormalLibraryTarget(CGLcore,$(GL_OBJS) $(BASE_OBJS))
+#endif
+NormalLibraryObjectRule()
+
+DependTarget()
diff --git a/nx-X11/programs/Xserver/GL/apple/aglGlx.c b/nx-X11/programs/Xserver/GL/apple/aglGlx.c
new file mode 100644
index 000000000..be846be83
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/apple/aglGlx.c
@@ -0,0 +1,1355 @@
+/*
+ * GLX implementation that uses Apple's AGL.framework for OpenGL
+ *
+ * FIXME: This file and indirect.c are very similar. The two should be
+ * merged by introducing suitable abstractions.
+ */
+/*
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Large portions of this file are copied from Mesa's xf86glx.c,
+ * which contains the following copyright:
+ *
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+/* $XFree86: xc/programs/Xserver/GL/apple/aglGlx.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include <AGL/agl.h>
+#include "cr.h"
+
+// X11 and X11's glx
+#undef BOOL
+#define BOOL xBOOL
+#include "quartz.h"
+#include <miscstruct.h>
+#include <windowstr.h>
+#include <resource.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include <glxscreens.h>
+#include <GL/internal/glcore.h>
+#undef BOOL
+
+#include "glcontextmodes.h"
+
+// ggs: needed to call back to glx with visual configs
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
+
+// Write debugging output, or not
+#ifdef GLAQUA_DEBUG
+#define GLAQUA_DEBUG_MSG ErrorF
+#else
+#define GLAQUA_DEBUG_MSG(a, ...)
+#endif
+
+
+// The following GL functions don't have an EXT suffix in OpenGL.framework.
+GLboolean glAreTexturesResidentEXT (GLsizei a, const GLuint *b, GLboolean *c) {
+ return glAreTexturesResident(a, b, c);
+}
+void glDeleteTexturesEXT (GLsizei d, const GLuint *e) {
+ glDeleteTextures(d, e);
+}
+void glGenTexturesEXT (GLsizei f, GLuint *g) {
+ glGenTextures(f, g);
+}
+GLboolean glIsTextureEXT (GLuint h) {
+ return glIsTexture(h);
+}
+
+
+// some prototypes
+static Bool glAquaScreenProbe(int screen);
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB);
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates);
+static __GLinterface *glAquaCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC);
+static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv);
+static void glAquaResetExtension(void);
+
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, modes, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ glAquaScreenProbe, /* Must be generic and handle all screens */
+ glAquaCreateContext, /* Substitute screen's createContext routine */
+ glAquaCreateBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up modes in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_APPLE,
+ glAquaResetExtension,
+ glAquaInitVisuals,
+ glAquaSetVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+// prototypes
+
+static GLboolean glAquaDestroyContext(__GLcontext *gc);
+static GLboolean glAquaLoseCurrent(__GLcontext *gc);
+static GLboolean glAquaMakeCurrent(__GLcontext *gc);
+static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare);
+static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask);
+static GLboolean glAquaForceCurrent(__GLcontext *gc);
+
+/* Drawing surface notification callbacks */
+static GLboolean glAquaNotifyResize(__GLcontext *gc);
+static void glAquaNotifyDestroy(__GLcontext *gc);
+static void glAquaNotifySwapBuffers(__GLcontext *gc);
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc);
+static void glAquaBeginDispatchOverride(__GLcontext *gc);
+static void glAquaEndDispatchOverride(__GLcontext *gc);
+
+
+static __GLexports glAquaExports = {
+ glAquaDestroyContext,
+ glAquaLoseCurrent,
+ glAquaMakeCurrent,
+ glAquaShareContext,
+ glAquaCopyContext,
+ glAquaForceCurrent,
+
+ glAquaNotifyResize,
+ glAquaNotifyDestroy,
+ glAquaNotifySwapBuffers,
+
+ glAquaDispatchExec,
+ glAquaBeginDispatchOverride,
+ glAquaEndDispatchOverride
+};
+
+
+typedef struct {
+ int num_vis;
+ __GLcontextModes *modes;
+ void **priv;
+
+ // wrapped screen functions
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+} glAquaScreenRec;
+
+static glAquaScreenRec glAquaScreens[MAXSCREENS];
+
+
+// __GLdrawablePrivate->private
+typedef struct {
+ GLboolean (*resize)(__GLdrawableBuffer *buf, GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask);
+} GLAquaDrawableRec;
+
+struct __GLcontextRec {
+ struct __GLinterfaceRec interface; // required to be first
+
+ AGLContext ctx;
+ AGLPixelFormat pixelFormat;
+
+ Bool isAttached; // TRUE if ctx is really attached to a window
+};
+
+
+// Context manipulation; return GL_FALSE on failure
+static GLboolean glAquaDestroyContext(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", gc->ctx);
+
+ if (gc) {
+ if (gc->ctx) aglDestroyContext(gc->ctx);
+ if (gc->pixelFormat) aglDestroyPixelFormat(gc->pixelFormat);
+ free(gc);
+ }
+
+ return GL_TRUE;
+}
+
+
+static GLboolean glAquaLoseCurrent(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", gc->ctx);
+
+ aglSetCurrentContext(NULL);
+ __glXLastContext = NULL; // Mesa does this; why?
+ gc->isAttached = FALSE;
+
+ return GL_TRUE;
+}
+
+
+/*
+ * Attach a GL context to a GL drawable
+ * If glPriv is NULL, the context is detached.
+ */
+static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv)
+{
+ __GLXdrawablePrivate *glxPriv;
+
+ if (glPriv == NULL) {
+ // attaching to nothing
+ GLAQUA_DEBUG_MSG("unattaching\n");
+ aglSetDrawable(gc->ctx, NULL);
+ gc->isAttached = FALSE;
+ return;
+ }
+
+ // Note that when resizing, the X11 WindowPtr already has its
+ // new size and position, but the Aqua window does not.
+
+ glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) glxPriv->pDraw;
+ WindowPtr topWin = quartzProcs->TopLevelParent(pWin);
+ CRWindowPtr crWinPtr;
+ AGLDrawable newPort;
+
+ if (glPriv->width <= 0 || glPriv->height <= 0) {
+ // attach to zero size drawable - will really attach later
+ GLAQUA_DEBUG_MSG("couldn't attach to zero size drawable\n");
+ aglSetDrawable(gc->ctx, NULL);
+ gc->isAttached = FALSE;
+ return;
+ }
+
+ crWinPtr = (CRWindowPtr) quartzProcs->FrameForWindow(pWin, FALSE);
+
+ if (crWinPtr) {
+ newPort = (AGLDrawable) crWinPtr->port;
+ } else {
+ newPort = NULL;
+ }
+
+ if (newPort) {
+ // FIXME: won't be a CGrafPtr if currently offscreen or fullscreen
+ AGLDrawable oldPort = aglGetDrawable(gc->ctx);
+ // AGLDrawable newPort = GetWindowPort(window);
+
+ // Frame is GLdrawable in X11 global coordinates
+ // FIXME: Does this work for multiple screens?
+ GLint frame[4] = {glPriv->xOrigin, glPriv->yOrigin, glPriv->width, glPriv->height};
+ GLAQUA_DEBUG_MSG("global size %d %d %d %d\n",
+ frame[0], frame[1], frame[2], frame[3]);
+
+ // Convert to window-local coordinates
+ frame[0] -= topWin->drawable.x - topWin->borderWidth;
+ frame[1] -= topWin->drawable.y - topWin->borderWidth;
+
+ // AGL uses flipped coordinates
+ frame[1] = topWin->drawable.height + 2*topWin->borderWidth -
+ frame[1] - frame[3];
+
+ GLAQUA_DEBUG_MSG("local size %d %d %d %d\n",
+ frame[0], frame[1], frame[2], frame[3]);
+
+ if (oldPort != newPort) {
+ // FIXME: retain/release windows
+ if (!aglSetDrawable(gc->ctx, newPort)) return;
+ }
+ if (!aglSetInteger(gc->ctx, AGL_BUFFER_RECT, frame)) return;
+ if (!aglEnable(gc->ctx, AGL_BUFFER_RECT)) return;
+ if (!aglSetInteger(gc->ctx, AGL_SWAP_RECT, frame)) return;
+ if (!aglEnable(gc->ctx, AGL_SWAP_RECT)) return;
+ if (!aglUpdateContext(gc->ctx)) return;
+
+ gc->isAttached = TRUE;
+ GLAQUA_DEBUG_MSG("attached context 0x%x to window 0x%x\n", gc->ctx,
+ pWin->drawable.id);
+ } else {
+ // attach to not-yet-realized window - will really attach later
+ GLAQUA_DEBUG_MSG("couldn't attach to unrealized window\n");
+ aglSetDrawable(gc->ctx, NULL);
+ gc->isAttached = FALSE;
+ }
+ } else {
+ GLAQUA_DEBUG_MSG("attach: attach to non-window unimplemented\n");
+ aglSetDrawable(gc->ctx, NULL);
+ gc->isAttached = FALSE;
+ }
+}
+
+static GLboolean glAquaMakeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
+
+ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", gc->ctx);
+
+ if (!gc->isAttached) {
+ attach(gc, glPriv);
+ }
+
+ return aglSetCurrentContext(gc->ctx);
+}
+
+static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n");
+
+ return GL_TRUE;
+}
+
+
+static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ GLAQUA_DEBUG_MSG("glAquaCopyContext\n");
+
+ return aglCopyContext(src->ctx, dst->ctx, mask);
+}
+
+static GLboolean glAquaForceCurrent(__GLcontext *gc)
+{
+ // GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", gc->ctx);
+ return aglSetCurrentContext(gc->ctx);
+}
+
+/* Drawing surface notification callbacks */
+
+static GLboolean glAquaNotifyResize(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize");
+ return GL_TRUE;
+}
+
+static void glAquaNotifyDestroy(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy");
+}
+
+static void glAquaNotifySwapBuffers(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers");
+}
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec");
+ return NULL;
+}
+
+static void glAquaBeginDispatchOverride(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride");
+}
+
+static void glAquaEndDispatchOverride(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride");
+}
+
+
+static AGLPixelFormat makeFormat(__GLcontextModes *mode)
+{
+ int i;
+ GLint attr[64]; // currently uses max of 30
+ AGLPixelFormat result;
+
+ GLAQUA_DEBUG_MSG("makeFormat\n");
+
+ i = 0;
+
+ // attr [i++] = AGL_ACCELERATED; // require hwaccel - BAD for multiscreen
+ // attr [i++] = AGL_NO_RECOVERY; // disable fallback renderers - BAD
+
+ if (mode->stereoMode) {
+ attr[i++] = AGL_STEREO;
+ }
+ if (mode->doubleBufferMode) {
+ attr[i++] = AGL_DOUBLEBUFFER;
+ }
+
+ if (mode->colorIndexMode) {
+ attr[i++] = AGL_BUFFER_SIZE;
+ attr[i++] = mode->indexBits;
+ }
+
+ if (mode->rgbMode) {
+ attr[i++] = AGL_RGBA;
+ attr[i++] = AGL_RED_SIZE;
+ attr[i++] = mode->redBits;
+ attr[i++] = AGL_GREEN_SIZE;
+ attr[i++] = mode->greenBits;
+ attr[i++] = AGL_BLUE_SIZE;
+ attr[i++] = mode->blueBits;
+ attr[i++] = AGL_ALPHA_SIZE;
+ attr[i++] = mode->alphaBits;
+ }
+
+ if (mode->haveAccumBuffer) {
+ attr[i++] = AGL_ACCUM_RED_SIZE;
+ attr[i++] = mode->accumRedBits;
+ attr[i++] = AGL_ACCUM_GREEN_SIZE;
+ attr[i++] = mode->accumGreenBits;
+ attr[i++] = AGL_ACCUM_BLUE_SIZE;
+ attr[i++] = mode->accumBlueBits;
+ attr[i++] = AGL_ACCUM_ALPHA_SIZE;
+ attr[i++] = mode->accumAlphaBits;
+ }
+ if (mode->haveDepthBuffer) {
+ attr[i++] = AGL_DEPTH_SIZE;
+ attr[i++] = mode->depthBits;
+ }
+ if (mode->haveStencilBuffer) {
+ attr[i++] = AGL_STENCIL_SIZE;
+ attr[i++] = mode->stencilBits;
+ }
+
+ attr[i++] = AGL_AUX_BUFFERS;
+ attr[i++] = mode->numAuxBuffers;
+
+ attr[i++] = AGL_LEVEL;
+ attr[i++] = mode->level;
+
+ // mode->pixmapMode ?
+
+ attr[i++] = AGL_NONE; // end of option list
+
+ GLAQUA_DEBUG_MSG("makeFormat almost done\n");
+ result = aglChoosePixelFormat(NULL, 0, attr);
+ GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", result);
+ return result;
+}
+
+static __GLinterface *glAquaCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC)
+{
+ __GLcontext *result;
+ __GLcontext *sharectx = (__GLcontext *)shareGC;
+
+ GLAQUA_DEBUG_MSG("glAquaCreateContext\n");
+
+ result = (__GLcontext *)calloc(1, sizeof(__GLcontext));
+ if (!result) return NULL;
+
+ result->interface.imports = *imports;
+ result->interface.exports = glAquaExports;
+
+ result->pixelFormat = makeFormat(mode);
+ if (!result->pixelFormat) {
+ free(result);
+ return NULL;
+ }
+
+ result->ctx = aglCreateContext(result->pixelFormat,
+ (sharectx && sharectx->ctx) ? sharectx->ctx : NULL);
+
+ if (!result->ctx) {
+ aglDestroyPixelFormat(result->pixelFormat);
+ free(result);
+ return NULL;
+ }
+
+ result->isAttached = FALSE;
+
+ GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
+ return (__GLinterface *)result;
+}
+
+
+Bool
+glAquaRealizeWindow(WindowPtr pWin)
+{
+ // If this window has GL contexts, tell them to reattach
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n");
+
+ // Allow the window to be created (RootlessRealizeWindow is inside our wrap)
+ pScreen->RealizeWindow = screenPriv->RealizeWindow;
+ result = pScreen->RealizeWindow(pWin);
+ pScreen->RealizeWindow = glAquaRealizeWindow;
+
+ // The Aqua window will already have been created (windows are
+ // realized from top down)
+
+ // Re-attach this window's GL contexts, if any.
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n");
+
+ // GL contexts bound to this window for drawing
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+
+ // GL contexts bound to this window for reading
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+ }
+
+ return result;
+}
+
+Bool
+glAquaUnrealizeWindow(WindowPtr pWin)
+{
+ // If this window has GL contexts, tell them to unattach
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n");
+
+ // The Aqua window may have already been destroyed (windows
+ // are unrealized from top down)
+
+ // Unattach this window's GL contexts, if any.
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n");
+
+ // GL contexts bound to this window for drawing
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, NULL);
+ }
+
+ // GL contexts bound to this window for reading
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, NULL);
+ }
+ }
+
+ pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
+ result = pScreen->UnrealizeWindow(pWin);
+ pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
+
+ return result;
+}
+
+
+// Originally copied from Mesa
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+static __GLXvisualConfig NullConfig = {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+};
+
+
+static int count_bits(unsigned int n)
+{
+ int bits = 0;
+
+ while (n > 0) {
+ if (n & 1) bits++;
+ n >>= 1;
+ }
+ return bits;
+}
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ GLAQUA_DEBUG_MSG("init_visuals\n");
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ int count;
+
+ count = ((pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs);
+ if (count == 0)
+ count = 1; /* preserve the existing visual */
+
+ numNewVisuals += count;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ glAquaScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ if (!is_rgb)
+ {
+ /* We don't support non-rgb visuals for GL. But we don't
+ want to remove them either, so just pass them through
+ with null glX configs */
+
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & NullConfig );
+ modes->visualID = pVisualNew[j].vid;
+
+ j++;
+
+ continue;
+ }
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+/* based on code in i830_dri.c
+ This ends calling glAquaSetVisualConfigs to set the static
+ numconfigs, etc. */
+static void
+glAquaInitVisualConfigs(void)
+{
+ int lclNumConfigs = 0;
+ __GLXvisualConfig *lclVisualConfigs = NULL;
+ void **lclVisualPrivates = NULL;
+
+ int depth, aux, buffers, stencil, accum;
+ int i = 0;
+
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs ");
+
+ /* count num configs:
+ 2 Z buffer (0, 24 bit)
+ 2 AUX buffer (0, 2)
+ 2 buffers (single, double)
+ 2 stencil (0, 8 bit)
+ 2 accum (0, 64 bit)
+ = 32 configs */
+
+ lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+
+ /* alloc */
+ lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs);
+ lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs);
+
+ /* fill in configs */
+ if (NULL != lclVisualConfigs) {
+ i = 0; /* current buffer */
+ for (depth = 0; depth < 2; depth++) {
+ for (aux = 0; aux < 2; aux++) {
+ for (buffers = 0; buffers < 2; buffers++) {
+ for (stencil = 0; stencil < 2; stencil++) {
+ for (accum = 0; accum < 2; accum++) {
+ lclVisualConfigs[i].vid = -1;
+ lclVisualConfigs[i].class = -1;
+ lclVisualConfigs[i].rgba = TRUE;
+ lclVisualConfigs[i].redSize = -1;
+ lclVisualConfigs[i].greenSize = -1;
+ lclVisualConfigs[i].blueSize = -1;
+ lclVisualConfigs[i].redMask = -1;
+ lclVisualConfigs[i].greenMask = -1;
+ lclVisualConfigs[i].blueMask = -1;
+ lclVisualConfigs[i].alphaMask = 0;
+ if (accum) {
+ lclVisualConfigs[i].accumRedSize = 16;
+ lclVisualConfigs[i].accumGreenSize = 16;
+ lclVisualConfigs[i].accumBlueSize = 16;
+ lclVisualConfigs[i].accumAlphaSize = 16;
+ }
+ else {
+ lclVisualConfigs[i].accumRedSize = 0;
+ lclVisualConfigs[i].accumGreenSize = 0;
+ lclVisualConfigs[i].accumBlueSize = 0;
+ lclVisualConfigs[i].accumAlphaSize = 0;
+ }
+ lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+ lclVisualConfigs[i].stereo = FALSE;
+ lclVisualConfigs[i].bufferSize = -1;
+
+ lclVisualConfigs[i].depthSize = depth? 24 : 0;
+ lclVisualConfigs[i].stencilSize = stencil ? 8 : 0;
+ lclVisualConfigs[i].auxBuffers = aux ? 2 : 0;
+ lclVisualConfigs[i].level = 0;
+ lclVisualConfigs[i].visualRating = GLX_NONE_EXT;
+ lclVisualConfigs[i].transparentPixel = 0;
+ lclVisualConfigs[i].transparentRed = 0;
+ lclVisualConfigs[i].transparentGreen = 0;
+ lclVisualConfigs[i].transparentBlue = 0;
+ lclVisualConfigs[i].transparentAlpha = 0;
+ lclVisualConfigs[i].transparentIndex = 0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (i != lclNumConfigs)
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs");
+
+ GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
+}
+
+
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n");
+
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB)
+{
+ GLAQUA_DEBUG_MSG("glAquaInitVisuals\n");
+
+ if (numConfigs == 0) /* if no configs */
+ glAquaInitVisualConfigs(); /* ensure the visual configs are setup */
+
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ glAquaScreenRec *pScr = &glAquaScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ GLAQUA_DEBUG_MSG("fixup_visuals\n");
+
+ for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ int *used;
+ int i, j;
+
+ GLAQUA_DEBUG_MSG("init_screen_visuals\n");
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = glAquaScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ (int)modes->visualType,
+ (unsigned int)(modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ __glXFree(used);
+}
+
+static Bool glAquaScreenProbe(int screen)
+{
+ ScreenPtr pScreen;
+ glAquaScreenRec *screenPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaScreenProbe\n");
+
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = glAquaScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = glAquaCreateContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ /*
+ * Wrap RealizeWindow and UnrealizeWindow on this screen
+ */
+ pScreen = screenInfo.screens[screen];
+ screenPriv = &glAquaScreens[screen];
+ screenPriv->RealizeWindow = pScreen->RealizeWindow;
+ pScreen->RealizeWindow = glAquaRealizeWindow;
+ screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
+ pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
+
+ return TRUE;
+}
+
+
+static GLboolean glAquaResizeBuffers(__GLdrawableBuffer *buffer,
+ GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask)
+{
+ GLAquaDrawableRec *aquaPriv = (GLAquaDrawableRec *)glPriv->private;
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+ __GLXcontext *gx;
+ __GLcontext *gc;
+
+ GLAQUA_DEBUG_MSG("glAquaResizeBuffers to (%d %d %d %d)\n", x, y, width, height);
+
+ // update all contexts that point at this drawable for drawing (hack?)
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+
+ // update all contexts that point at this drawable for reading (hack?)
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+
+ return aquaPriv->resize(buffer, x, y, width, height, glPriv, bufferMask);
+}
+
+
+static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ // fixme AGL software renderer will use properties of current QD port (bad)
+
+ // swap buffers on only *one* of the contexts
+ // (e.g. the last one for drawing)
+ __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
+ if (gc && gc->ctx) aglSwapBuffers(gc->ctx);
+
+ return GL_TRUE;
+}
+
+static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
+{
+ GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
+
+ free(glPriv->private);
+ glPriv->private = NULL;
+}
+
+static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec));
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n");
+
+ // replace swapBuffers (original is never called)
+ glxPriv->swapBuffers = glAquaSwapBuffers;
+
+ // wrap front buffer resize
+ aquaPriv->resize = glPriv->frontBuffer.resize;
+ glPriv->frontBuffer.resize = glAquaResizeBuffers;
+
+ // stash private data
+ glPriv->private = aquaPriv;
+ glPriv->freePrivate = glAquaDestroyDrawablePrivate;
+}
+
+
+static void glAquaResetExtension(void)
+{
+ GLAQUA_DEBUG_MSG("glAquaResetExtension\n");
+ aglResetLibrary();
+}
+
+
+
+// Extra goodies for glx
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
diff --git a/nx-X11/programs/Xserver/GL/apple/indirect.c b/nx-X11/programs/Xserver/GL/apple/indirect.c
new file mode 100644
index 000000000..448b1f76a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/apple/indirect.c
@@ -0,0 +1,1380 @@
+/*
+ * GLX implementation that uses Apple's OpenGL.framework
+ * (Indirect rendering path)
+ */
+/*
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ * Copyright (c) 2002 Apple Computer, Inc.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Portions of this file are copied from Mesa's xf86glx.c,
+ * which contains the following copyright:
+ *
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+/* $XFree86: xc/programs/Xserver/GL/apple/indirect.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "dri.h"
+#include "quartz.h"
+
+#include <CoreGraphics/CoreGraphics.h>
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLContext.h>
+
+// X11 and X11's glx
+#include <miscstruct.h>
+#include <windowstr.h>
+#include <resource.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include <glxscreens.h>
+#include <GL/internal/glcore.h>
+#include "x-hash.h"
+#include "x-list.h"
+
+#include "glcontextmodes.h"
+
+// ggs: needed to call back to glx with visual configs
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
+
+
+// Write debugging output, or not
+#ifdef GLAQUA_DEBUG
+#define GLAQUA_DEBUG_MSG ErrorF
+#else
+#define GLAQUA_DEBUG_MSG(a, ...)
+#endif
+
+
+// The following GL functions don't have an EXT suffix in OpenGL.framework.
+GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) {
+ return glAreTexturesResident(a, b, c);
+}
+void glDeleteTexturesEXT(GLsizei d, const GLuint *e) {
+ glDeleteTextures(d, e);
+}
+void glGenTexturesEXT(GLsizei f, GLuint *g) {
+ glGenTextures(f, g);
+}
+GLboolean glIsTextureEXT(GLuint h) {
+ return glIsTexture(h);
+}
+
+// some prototypes
+static Bool glAquaScreenProbe(int screen);
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB);
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates);
+static __GLinterface *glAquaCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC);
+static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv);
+static void glAquaResetExtension(void);
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, modes, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ glAquaScreenProbe, /* Must be generic and handle all screens */
+ glAquaCreateContext, /* Substitute screen's createContext routine */
+ glAquaCreateBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up modes in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_APPLE,
+ glAquaResetExtension,
+ glAquaInitVisuals,
+ glAquaSetVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+// prototypes
+
+static GLboolean glAquaDestroyContext(__GLcontext *gc);
+static GLboolean glAquaLoseCurrent(__GLcontext *gc);
+static GLboolean glAquaMakeCurrent(__GLcontext *gc);
+static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare);
+static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask);
+static GLboolean glAquaForceCurrent(__GLcontext *gc);
+
+/* Drawing surface notification callbacks */
+static GLboolean glAquaNotifyResize(__GLcontext *gc);
+static void glAquaNotifyDestroy(__GLcontext *gc);
+static void glAquaNotifySwapBuffers(__GLcontext *gc);
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc);
+static void glAquaBeginDispatchOverride(__GLcontext *gc);
+static void glAquaEndDispatchOverride(__GLcontext *gc);
+
+static __GLexports glAquaExports = {
+ glAquaDestroyContext,
+ glAquaLoseCurrent,
+ glAquaMakeCurrent,
+ glAquaShareContext,
+ glAquaCopyContext,
+ glAquaForceCurrent,
+
+ glAquaNotifyResize,
+ glAquaNotifyDestroy,
+ glAquaNotifySwapBuffers,
+
+ glAquaDispatchExec,
+ glAquaBeginDispatchOverride,
+ glAquaEndDispatchOverride
+};
+
+typedef struct {
+ int num_vis;
+ __GLcontextModes *modes;
+ void **priv;
+
+ // wrapped screen functions
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+} glAquaScreenRec;
+
+static glAquaScreenRec glAquaScreens[MAXSCREENS];
+
+// __GLdrawablePrivate->private
+typedef struct {
+ DrawablePtr pDraw;
+ xp_surface_id sid;
+} GLAquaDrawableRec;
+
+struct __GLcontextRec {
+ struct __GLinterfaceRec interface; // required to be first
+
+ CGLContextObj ctx;
+ CGLPixelFormatObj pixelFormat;
+
+ /* set when attached */
+ xp_surface_id sid;
+
+ unsigned isAttached :1;
+};
+
+/* maps from surface id -> list of __GLcontext */
+static x_hash_table *surface_hash;
+
+
+// Context manipulation; return GL_FALSE on failure
+static GLboolean glAquaDestroyContext(__GLcontext *gc)
+{
+ x_list *lst;
+
+ GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n",
+ (unsigned int) gc->ctx);
+
+ if (gc != NULL)
+ {
+ if (gc->sid != 0 && surface_hash != NULL)
+ {
+ lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
+ lst = x_list_remove(lst, gc);
+ x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
+ }
+
+ if (gc->ctx != NULL)
+ CGLDestroyContext(gc->ctx);
+
+ if (gc->pixelFormat != NULL)
+ CGLDestroyPixelFormat(gc->pixelFormat);
+
+ free(gc);
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean glAquaLoseCurrent(__GLcontext *gc)
+{
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx);
+
+ gl_err = CGLSetCurrentContext(NULL);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ __glXLastContext = NULL; // Mesa does this; why?
+
+ return GL_TRUE;
+}
+
+/* Called when a surface is destroyed as a side effect of destroying
+ the window it's attached to. */
+static void surface_notify(void *_arg, void *data)
+{
+ DRISurfaceNotifyArg *arg = _arg;
+ GLAquaDrawableRec *aquaPriv = data;
+ __GLcontext *gc;
+ x_list *lst;
+
+ switch (arg->kind)
+ {
+ case AppleDRISurfaceNotifyDestroyed:
+ if (surface_hash != NULL)
+ x_hash_table_remove(surface_hash, (void *) arg->id);
+
+ aquaPriv->pDraw = NULL;
+ aquaPriv->sid = 0;
+ break;
+
+ case AppleDRISurfaceNotifyChanged:
+ if (surface_hash != NULL)
+ {
+ lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL);
+ for (; lst != NULL; lst = lst->next)
+ {
+ gc = lst->data;
+ xp_update_gl_context(gc->ctx);
+ }
+ }
+ break;
+ }
+}
+
+static void unattach(__GLcontext *gc)
+{
+ x_list *lst;
+
+ if (gc->isAttached)
+ {
+ GLAQUA_DEBUG_MSG("unattaching\n");
+
+ if (surface_hash != NULL)
+ {
+ lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
+ lst = x_list_remove(lst, gc);
+ x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
+ }
+
+ CGLClearDrawable(gc->ctx);
+ gc->isAttached = FALSE;
+ gc->sid = 0;
+ }
+}
+
+static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv)
+{
+ __GLXdrawablePrivate *glxPriv;
+ GLAquaDrawableRec *aquaPriv;
+ DrawablePtr pDraw;
+
+ glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+ aquaPriv = (GLAquaDrawableRec *)glPriv->private;
+ pDraw = glxPriv->pDraw;
+
+ if (aquaPriv->sid == 0)
+ {
+ if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
+ 0, &aquaPriv->sid, NULL,
+ surface_notify, aquaPriv))
+ {
+ return;
+ }
+ aquaPriv->pDraw = pDraw;
+ }
+
+ if (!gc->isAttached || gc->sid != aquaPriv->sid)
+ {
+ x_list *lst;
+
+ if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success)
+ {
+ quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
+ surface_notify, aquaPriv);
+ if (surface_hash != NULL)
+ x_hash_table_remove(surface_hash, (void *) aquaPriv->sid);
+
+ aquaPriv->sid = 0;
+ return;
+ }
+
+ gc->isAttached = TRUE;
+ gc->sid = aquaPriv->sid;
+
+ if (surface_hash == NULL)
+ surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
+
+ lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
+ if (x_list_find(lst, gc) == NULL)
+ {
+ lst = x_list_prepend(lst, gc);
+ x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
+ }
+
+ GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id,
+ (unsigned int) aquaPriv->sid);
+ }
+}
+
+static GLboolean glAquaMakeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx);
+
+ attach(gc, glPriv);
+
+ gl_err = CGLSetCurrentContext(gc->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n");
+
+ return GL_TRUE;
+}
+
+static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaCopyContext\n");
+
+ gl_err = CGLCopyContext(src->ctx, dst->ctx, mask);
+ if (gl_err != 0)
+ ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+static GLboolean glAquaForceCurrent(__GLcontext *gc)
+{
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n",
+ (unsigned int) gc->ctx);
+
+ gl_err = CGLSetCurrentContext(gc->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+/* Drawing surface notification callbacks */
+
+static GLboolean glAquaNotifyResize(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize");
+ return GL_TRUE;
+}
+
+static void glAquaNotifyDestroy(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy");
+}
+
+static void glAquaNotifySwapBuffers(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers");
+}
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec");
+ return NULL;
+}
+
+static void glAquaBeginDispatchOverride(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride");
+}
+
+static void glAquaEndDispatchOverride(__GLcontext *gc)
+{
+ GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride");
+}
+
+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode)
+{
+ int i;
+ CGLPixelFormatAttribute attr[64]; // currently uses max of 30
+ CGLPixelFormatObj result;
+ long n_formats;
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("makeFormat\n");
+
+ if (!mode->rgbMode)
+ return NULL;
+
+ i = 0;
+
+ // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen
+ // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD
+
+ if (mode->stereoMode) {
+ attr[i++] = kCGLPFAStereo;
+ }
+ if (mode->doubleBufferMode) {
+ attr[i++] = kCGLPFADoubleBuffer;
+ }
+
+ if (mode->colorIndexMode) {
+ /* ignored */
+ }
+
+ if (mode->rgbMode) {
+ attr[i++] = kCGLPFAColorSize;
+ attr[i++] = mode->redBits + mode->greenBits + mode->blueBits;
+ attr[i++] = kCGLPFAAlphaSize;
+ attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */
+ }
+
+ if (mode->haveAccumBuffer) {
+ attr[i++] = kCGLPFAAccumSize;
+ attr[i++] = mode->accumRedBits + mode->accumGreenBits
+ + mode->accumBlueBits + mode->accumAlphaBits;
+ }
+ if (mode->haveDepthBuffer) {
+ attr[i++] = kCGLPFADepthSize;
+ attr[i++] = mode->depthBits;
+ }
+ if (mode->haveStencilBuffer) {
+ attr[i++] = kCGLPFAStencilSize;
+ attr[i++] = mode->stencilBits;
+ }
+
+ attr[i++] = kCGLPFAAuxBuffers;
+ attr[i++] = mode->numAuxBuffers;
+
+ /* mode->level ignored */
+
+ /* mode->pixmapMode ? */
+
+ attr[i++] = 0;
+
+ GLAQUA_DEBUG_MSG("makeFormat almost done\n");
+
+ result = NULL;
+ gl_err = CGLChoosePixelFormat(attr, &result, &n_formats);
+ if (gl_err != 0)
+ ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err));
+
+ GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", (unsigned int) result);
+
+ return result;
+}
+
+static __GLinterface *glAquaCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC)
+{
+ __GLcontext *result;
+ __GLcontext *sharectx = (__GLcontext *)shareGC;
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaCreateContext\n");
+
+ result = (__GLcontext *)calloc(1, sizeof(__GLcontext));
+ if (!result) return NULL;
+
+ result->interface.imports = *imports;
+ result->interface.exports = glAquaExports;
+
+ result->pixelFormat = makeFormat(mode);
+ if (!result->pixelFormat) {
+ free(result);
+ return NULL;
+ }
+
+ result->ctx = NULL;
+ gl_err = CGLCreateContext(result->pixelFormat,
+ sharectx ? sharectx->ctx : NULL,
+ &result->ctx);
+
+ if (gl_err != 0) {
+ ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err));
+ CGLDestroyPixelFormat(result->pixelFormat);
+ free(result);
+ return NULL;
+ }
+
+ GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
+ return (__GLinterface *)result;
+}
+
+Bool
+glAquaRealizeWindow(WindowPtr pWin)
+{
+ // If this window has GL contexts, tell them to reattach
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n");
+
+ // Allow the window to be created (RootlessRealizeWindow is inside our wrap)
+ pScreen->RealizeWindow = screenPriv->RealizeWindow;
+ result = pScreen->RealizeWindow(pWin);
+ pScreen->RealizeWindow = glAquaRealizeWindow;
+
+ // The Aqua window will already have been created (windows are
+ // realized from top down)
+
+ // Re-attach this window's GL contexts, if any.
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n");
+
+ // GL contexts bound to this window for drawing
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+
+ // GL contexts bound to this window for reading
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ attach(gc, glPriv);
+ }
+ }
+
+ return result;
+}
+
+Bool
+glAquaUnrealizeWindow(WindowPtr pWin)
+{
+ // If this window has GL contexts, tell them to unattach
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n");
+
+ // The Aqua window may have already been destroyed (windows
+ // are unrealized from top down)
+
+ // Unattach this window's GL contexts, if any.
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n");
+
+ // GL contexts bound to this window for drawing
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ unattach(gc);
+ }
+
+ // GL contexts bound to this window for reading
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ unattach(gc);
+ }
+ }
+
+ pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
+ result = pScreen->UnrealizeWindow(pWin);
+ pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
+
+ return result;
+}
+
+
+// Originally copied from Mesa
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+static __GLXvisualConfig NullConfig = {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+};
+
+
+static inline int count_bits(uint32_t x)
+{
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0f0f0f0f;
+ x = x + (x >> 8);
+ x = x + (x >> 16);
+ return x & 63;
+}
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ GLAQUA_DEBUG_MSG("init_visuals\n");
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ int count;
+
+ count = ((pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs);
+ if (count == 0)
+ count = 1; /* preserve the existing visual */
+
+ numNewVisuals += count;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ glAquaScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ if (!is_rgb)
+ {
+ /* We don't support non-rgb visuals for GL. But we don't
+ want to remove them either, so just pass them through
+ with null glX configs */
+
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & NullConfig );
+ modes->visualID = pVisualNew[j].vid;
+
+ j++;
+
+ continue;
+ }
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+/* based on code in i830_dri.c
+ This ends calling glAquaSetVisualConfigs to set the static
+ numconfigs, etc. */
+static void
+glAquaInitVisualConfigs(void)
+{
+ int lclNumConfigs = 0;
+ __GLXvisualConfig *lclVisualConfigs = NULL;
+ void **lclVisualPrivates = NULL;
+
+ int depth, aux, buffers, stencil, accum;
+ int i = 0;
+
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs ");
+
+ /* count num configs:
+ 2 Z buffer (0, 24 bit)
+ 2 AUX buffer (0, 2)
+ 2 buffers (single, double)
+ 2 stencil (0, 8 bit)
+ 2 accum (0, 64 bit)
+ = 32 configs */
+
+ lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+
+ /* alloc */
+ lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs);
+ lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs);
+
+ /* fill in configs */
+ if (NULL != lclVisualConfigs) {
+ i = 0; /* current buffer */
+ for (depth = 0; depth < 2; depth++) {
+ for (aux = 0; aux < 2; aux++) {
+ for (buffers = 0; buffers < 2; buffers++) {
+ for (stencil = 0; stencil < 2; stencil++) {
+ for (accum = 0; accum < 2; accum++) {
+ lclVisualConfigs[i].vid = -1;
+ lclVisualConfigs[i].class = -1;
+ lclVisualConfigs[i].rgba = TRUE;
+ lclVisualConfigs[i].redSize = -1;
+ lclVisualConfigs[i].greenSize = -1;
+ lclVisualConfigs[i].blueSize = -1;
+ lclVisualConfigs[i].redMask = -1;
+ lclVisualConfigs[i].greenMask = -1;
+ lclVisualConfigs[i].blueMask = -1;
+ lclVisualConfigs[i].alphaMask = 0;
+ if (accum) {
+ lclVisualConfigs[i].accumRedSize = 16;
+ lclVisualConfigs[i].accumGreenSize = 16;
+ lclVisualConfigs[i].accumBlueSize = 16;
+ lclVisualConfigs[i].accumAlphaSize = 16;
+ }
+ else {
+ lclVisualConfigs[i].accumRedSize = 0;
+ lclVisualConfigs[i].accumGreenSize = 0;
+ lclVisualConfigs[i].accumBlueSize = 0;
+ lclVisualConfigs[i].accumAlphaSize = 0;
+ }
+ lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+ lclVisualConfigs[i].stereo = FALSE;
+ lclVisualConfigs[i].bufferSize = -1;
+
+ lclVisualConfigs[i].depthSize = depth? 24 : 0;
+ lclVisualConfigs[i].stencilSize = stencil ? 8 : 0;
+ lclVisualConfigs[i].auxBuffers = aux ? 2 : 0;
+ lclVisualConfigs[i].level = 0;
+ lclVisualConfigs[i].visualRating = GLX_NONE_EXT;
+ lclVisualConfigs[i].transparentPixel = 0;
+ lclVisualConfigs[i].transparentRed = 0;
+ lclVisualConfigs[i].transparentGreen = 0;
+ lclVisualConfigs[i].transparentBlue = 0;
+ lclVisualConfigs[i].transparentAlpha = 0;
+ lclVisualConfigs[i].transparentIndex = 0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (i != lclNumConfigs)
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs");
+
+ GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
+}
+
+
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n");
+
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB)
+{
+ GLAQUA_DEBUG_MSG("glAquaInitVisuals\n");
+
+ if (numConfigs == 0) /* if no configs */
+ glAquaInitVisualConfigs(); /* ensure the visual configs are setup */
+
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ glAquaScreenRec *pScr = &glAquaScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ GLAQUA_DEBUG_MSG("fixup_visuals\n");
+
+ for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ int *used;
+ int i, j;
+
+ GLAQUA_DEBUG_MSG("init_screen_visuals\n");
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = glAquaScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ (int)modes->visualType,
+ (unsigned int)(modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ __glXFree(used);
+}
+
+static Bool glAquaScreenProbe(int screen)
+{
+ ScreenPtr pScreen;
+ glAquaScreenRec *screenPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaScreenProbe\n");
+
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = glAquaScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = glAquaCreateContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ /*
+ * Wrap RealizeWindow and UnrealizeWindow on this screen
+ */
+ pScreen = screenInfo.screens[screen];
+ screenPriv = &glAquaScreens[screen];
+ screenPriv->RealizeWindow = pScreen->RealizeWindow;
+ pScreen->RealizeWindow = glAquaRealizeWindow;
+ screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
+ pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
+
+ return TRUE;
+}
+
+static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ // swap buffers on only *one* of the contexts
+ // (e.g. the last one for drawing)
+ __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n");
+
+ if (gc != NULL && gc->ctx != NULL)
+ {
+ gl_err = CGLFlushDrawable(gc->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err));
+ }
+
+ return GL_TRUE;
+}
+
+static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
+{
+ GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
+
+ /* It doesn't work to call DRIDestroySurface here, the drawable's
+ already gone.. But dri.c notices the window destruction and
+ frees the surface itself. */
+
+ free(glPriv->private);
+ glPriv->private = NULL;
+}
+
+static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec));
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+
+ aquaPriv->sid = 0;
+ aquaPriv->pDraw = NULL;
+
+ GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n");
+
+ // replace swapBuffers (original is never called)
+ glxPriv->swapBuffers = glAquaSwapBuffers;
+
+ // stash private data
+ glPriv->private = aquaPriv;
+ glPriv->freePrivate = glAquaDestroyDrawablePrivate;
+}
+
+static void glAquaResetExtension(void)
+{
+ GLAQUA_DEBUG_MSG("glAquaResetExtension\n");
+ CGLSetOption(kCGLGOResetLibrary, GL_TRUE);
+}
+
+// Extra goodies for glx
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile b/nx-X11/programs/Xserver/GL/dri/Imakefile
new file mode 100644
index 000000000..8ea938f8c
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/Imakefile
@@ -0,0 +1,35 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.6 2001/04/28 13:55:36 dawes Exp $
+
+#define IHaveModules
+#include <Server.tmpl>
+
+#if DoLoadableServer
+MSRC = drimodule.c
+MOBJ = drimodule.o
+#endif
+
+ SRCS = xf86dri.c dri.c $(MSRC)
+ OBJS = xf86dri.o dri.o $(MOBJ)
+
+ INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) -I$(MESASRCDIR)/include \
+ -I$(XF86OSSRC) -I$(XF86COMSRC) \
+ -I../include -I../glx -I$(LIBSRC)/GL/include \
+ -I$(DRMSRCDIR)/shared-core \
+ -I$(SERVERSRC)/mi -I$(FONTINCSRC)
+ DEFINES = $(GLX_DEFINES)
+
+LinkSourceFile(xf86dri.h,$(MESASRCDIR)/src/glx/x11)
+LinkSourceFile(xf86dristr.h,$(MESASRCDIR)/src/glx/x11)
+
+ModuleObjectRule()
+LibraryModuleTarget(dri,$(OBJS))
+InstallLibraryModule(dri,$(MODULEDIR),extensions)
+
+DependTarget()
+
+InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions)
+
+InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR))
diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference
new file mode 100644
index 000000000..59fb0af84
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference
@@ -0,0 +1,35 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $
+
+#define IHaveModules
+#include <Server.tmpl>
+
+#if DoLoadableServer
+MSRC = drimodule.c
+MOBJ = drimodule.o
+#endif
+
+ SRCS = xf86dri.c dri.c $(MSRC)
+ OBJS = xf86dri.o dri.o $(MOBJ)
+
+ INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(XF86OSSRC) -I$(XF86COMSRC) \
+ -I../include -I../glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/mi -I$(FONTINCSRC) \
+ -I../../hw/xfree86/os-support/bus
+ DEFINES = $(GLX_DEFINES)
+
+LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri)
+LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri)
+
+ModuleObjectRule()
+LibraryModuleTarget(dri,$(OBJS))
+InstallLibraryModule(dri,$(MODULEDIR),extensions)
+
+DependTarget()
+
+InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions)
+
+InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR))
diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference
new file mode 100644
index 000000000..c8770f6d8
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference
@@ -0,0 +1,34 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $
+
+#define IHaveModules
+#include <Server.tmpl>
+
+#if DoLoadableServer
+MSRC = drimodule.c
+MOBJ = drimodule.o
+#endif
+
+ SRCS = xf86dri.c dri.c $(MSRC)
+ OBJS = xf86dri.o dri.o $(MOBJ)
+
+ INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(XF86OSSRC) -I$(XF86COMSRC) \
+ -I../include -I../glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/mi -I$(FONTINCSRC)
+ DEFINES = $(GLX_DEFINES)
+
+LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri)
+LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri)
+
+ModuleObjectRule()
+LibraryModuleTarget(dri,$(OBJS))
+InstallLibraryModule(dri,$(MODULEDIR),extensions)
+
+DependTarget()
+
+InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions)
+
+InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR))
diff --git a/nx-X11/programs/Xserver/GL/dri/dri-def.cpp b/nx-X11/programs/Xserver/GL/dri/dri-def.cpp
new file mode 100644
index 000000000..0d1ab6872
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/dri-def.cpp
@@ -0,0 +1,50 @@
+LIBRARY DRI
+VERSION LIBRARY_VERSION
+EXPORTS
+
+XFree86DRIExtensionInit
+DRIAuthConnection
+DRIBlockHandler
+DRIClipNotify
+DRICloseConnection
+DRICloseScreen
+DRIContextPrivDelete
+DRICopyWindow
+DRICreateContext
+DRICreateContextPriv
+DRICreateContextPrivFromHandle
+DRICreateDrawable
+DRICreateInfoRec
+DRIDestroyContext
+DRIDestroyContextPriv
+DRIDestroyDrawable
+DRIDestroyInfoRec
+DRIDoBlockHandler
+DRIDoWakeupHandler
+DRIDrawablePrivDelete
+DRIExtensionInit
+DRIFinishScreenInit
+DRIGetClientDriverName
+DRIGetContext
+DRIGetContextStore
+DRIGetDeviceInfo
+DRIGetDrawableIndex
+DRIGetDrawableInfo
+DRIGetDrawableStamp
+DRIGetSAREAPrivate
+DRIGetWrappedFuncs
+DRILock
+DRIOpenConnection
+DRIPaintWindow
+DRIPostValidateTree
+DRIPrintDrawableLock
+DRIQueryDirectRenderingCapable
+DRIQueryVersion
+DRIReset
+DRIScreenInit
+DRISwapContext
+DRIUnlock
+DRIValidateTree
+DRIWakeupHandler
+
+/* $XFree86$ */
diff --git a/nx-X11/programs/Xserver/GL/dri/dri.c b/nx-X11/programs/Xserver/GL/dri/dri.c
new file mode 100644
index 000000000..424a21c68
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/dri.c
@@ -0,0 +1,2109 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@tungstengraphics.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "servermd.h"
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+#include "swaprep.h"
+#include "xf86str.h"
+#include "dri.h"
+#include "sarea.h"
+#include "dristruct.h"
+#include "xf86.h"
+#include "xf86drm.h"
+#include "glxserver.h"
+#include "mi.h"
+#include "mipointer.h"
+
+#if defined(XFree86LOADER) && !defined(PANORAMIX)
+extern Bool noPanoramiXExtension;
+#endif
+
+static int DRIScreenPrivIndex = -1;
+static int DRIWindowPrivIndex = -1;
+static unsigned long DRIGeneration = 0;
+static unsigned int DRIDrawableValidationStamp = 0;
+
+static RESTYPE DRIDrawablePrivResType;
+static RESTYPE DRIContextPrivResType;
+static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv);
+
+ /* Wrapper just like xf86DrvMsg, but
+ without the verbosity level checking.
+ This will make it easy to turn off some
+ messages later, based on verbosity
+ level. */
+
+/*
+ * Since we're already referencing things from the XFree86 common layer in
+ * this file, we'd might as well just call xf86VDrvMsgVerb, and have
+ * consistent message formatting. The verbosity of these messages can be
+ * easily changed here.
+ */
+#define DRI_MSG_VERBOSITY 1
+static void
+DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap);
+ va_end(ap);
+}
+
+Bool
+DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
+{
+ DRIScreenPrivPtr pDRIPriv;
+ drm_context_t * reserved;
+ int reserved_count;
+ int i, fd, drmWasAvailable;
+ Bool xineramaInCore = FALSE;
+ int err = 0;
+ char *openbusid;
+ drmVersionPtr drmlibv;
+ int drmlibmajor, drmlibminor, drmdimajor, drmdiminor;
+
+ if (DRIGeneration != serverGeneration) {
+ if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ DRIGeneration = serverGeneration;
+ }
+
+ /* If the DRI extension is disabled, do not initialize the DRI */
+ if (noXFree86DRIExtension) {
+ DRIDrvMsg(pScreen->myNum, X_WARNING,
+ "Direct rendering has been disabled.\n");
+ return FALSE;
+ }
+
+ /*
+ * If Xinerama is on, don't allow DRI to initialise. It won't be usable
+ * anyway.
+ */
+#if defined(PANORAMIX) && !defined(XFree86LOADER)
+ xineramaInCore = TRUE;
+#elif defined(XFree86LOADER)
+ if (xf86LoaderCheckSymbol("noPanoramiXExtension"))
+ xineramaInCore = TRUE;
+#endif
+
+#if defined(PANORAMIX) || defined(XFree86LOADER)
+ if (xineramaInCore) {
+ if (!noPanoramiXExtension) {
+ DRIDrvMsg(pScreen->myNum, X_WARNING,
+ "Direct rendering is not supported when Xinerama is enabled\n");
+ return FALSE;
+ }
+ }
+#endif
+
+ drmWasAvailable = drmAvailable();
+
+ /* Check the DRM lib version.
+ * drmGetLibVersion was not supported in version 1.0, so check for
+ * symbol first to avoid possible crash or hang.
+ */
+ drmlibmajor = 1;
+ drmlibminor = 0;
+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
+ drmlibv = drmGetLibVersion(-1);
+ if (drmlibv != NULL) {
+ drmlibmajor = drmlibv->version_major;
+ drmlibminor = drmlibv->version_minor;
+ drmFreeVersion(drmlibv);
+ }
+ }
+
+ /* Check if the libdrm can handle falling back to loading based on name
+ * if a busid string is passed.
+ */
+ if (drmlibmajor == 1 && drmlibminor >= 2)
+ openbusid = pDRIInfo->busIdString;
+ else
+ openbusid = NULL;
+
+ /* Note that drmOpen will try to load the kernel module, if needed. */
+ fd = drmOpen(pDRIInfo->drmDriverName, openbusid);
+ if (fd < 0) {
+ /* failed to open DRM */
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmOpen failed\n");
+ return FALSE;
+ }
+
+ if (!drmWasAvailable) {
+ /* drmOpen loaded the kernel module, print a message to say so */
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] loaded kernel module for \"%s\" driver\n",
+ pDRIInfo->drmDriverName);
+ }
+
+ pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
+ if (!pDRIPriv) {
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ return FALSE;
+ }
+
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv;
+ pDRIPriv->drmFD = fd;
+ pDRIPriv->directRenderingSupport = TRUE;
+ pDRIPriv->pDriverInfo = pDRIInfo;
+ pDRIPriv->nrWindows = 0;
+ pDRIPriv->fullscreen = NULL;
+
+ pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx;
+ pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv;
+
+ pDRIPriv->grabbedDRILock = FALSE;
+ pDRIPriv->drmSIGIOHandlerInstalled = FALSE;
+
+ if (drmlibmajor == 1 && drmlibminor >= 2) {
+ drmSetVersion sv;
+
+ /* Get the interface version, asking for 1.1. */
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 1;
+ sv.drm_dd_major = -1;
+ err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv);
+ if (err == 0) {
+ drmdimajor = sv.drm_di_major;
+ drmdiminor = sv.drm_di_minor;
+ } else {
+ /* failure, so set it to 1.0.0. */
+ drmdimajor = 1;
+ drmdiminor = 0;
+ }
+ }
+ else {
+ /* We can't check the DI DRM interface version, so set it to 1.0.0. */
+ drmdimajor = 1;
+ drmdiminor = 0;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor);
+
+ /* If the interface minor number is 1.1, then we've opened a DRM device
+ * that already had the busid set through drmOpen.
+ */
+ if (drmdimajor == 1 && drmdiminor >= 1)
+ err = 0;
+ else
+ err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString);
+
+ if (err < 0) {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmSetBusid failed (%d, %s), %s\n",
+ pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err));
+ return FALSE;
+ }
+
+ *pDRMFD = pDRIPriv->drmFD;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] created \"%s\" driver at busid \"%s\"\n",
+ pDRIPriv->pDriverInfo->drmDriverName,
+ pDRIPriv->pDriverInfo->busIdString);
+
+ if (drmAddMap( pDRIPriv->drmFD,
+ 0,
+ pDRIPriv->pDriverInfo->SAREASize,
+ DRM_SHM,
+ DRM_CONTAINS_LOCK,
+ &pDRIPriv->hSAREA) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmAddMap failed\n");
+ return FALSE;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] added %d byte SAREA at %p\n",
+ pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA);
+
+ if (drmMap( pDRIPriv->drmFD,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pDriverInfo->SAREASize,
+ (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmMap failed\n");
+ return FALSE;
+ }
+ memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize);
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n",
+ pDRIPriv->hSAREA, pDRIPriv->pSAREA);
+
+ if (drmAddMap( pDRIPriv->drmFD,
+ (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
+ pDRIPriv->pDriverInfo->frameBufferSize,
+ DRM_FRAME_BUFFER,
+ 0,
+ &pDRIPriv->hFrameBuffer) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize);
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmAddMap failed\n");
+ return FALSE;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n",
+ pDRIPriv->hFrameBuffer);
+
+ /* Add tags for reserved contexts */
+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
+ &reserved_count))) {
+ int i;
+ void *tag;
+
+ for (i = 0; i < reserved_count; i++) {
+ tag = DRICreateContextPrivFromHandle(pScreen,
+ reserved[i],
+ DRI_CONTEXT_RESERVED);
+ drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag);
+ }
+ drmFreeReservedContextList(reserved);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] added %d reserved context%s for kernel\n",
+ reserved_count, reserved_count > 1 ? "s" : "");
+ }
+
+ /* validate max drawable table entry set by driver */
+ if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) ||
+ (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "Invalid max drawable table size set by driver: %d\n",
+ pDRIPriv->pDriverInfo->maxDrawableTableEntry);
+ }
+
+ /* Initialize drawable tables (screen private and SAREA) */
+ for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
+ pDRIPriv->DRIDrawables[i] = NULL;
+ pDRIPriv->pSAREA->drawableTable[i].stamp = 0;
+ pDRIPriv->pSAREA->drawableTable[i].flags = 0;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIFinishScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+ DRIContextFlags flags = 0;
+ DRIContextPrivPtr pDRIContextPriv;
+
+ /* Set up flags for DRICreateContextPriv */
+ switch (pDRIInfo->driverSwapMethod) {
+ case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break;
+ case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break;
+ }
+
+ if (!(pDRIContextPriv = DRICreateContextPriv(pScreen,
+ &pDRIPriv->myContext,
+ flags))) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to create server context\n");
+ return FALSE;
+ }
+ pDRIPriv->myContextPriv = pDRIContextPriv;
+
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "X context handle = %p\n", pDRIPriv->myContext);
+
+ /* Now that we have created the X server's context, we can grab the
+ * hardware lock for the X server.
+ */
+ DRILock(pScreen, 0);
+ pDRIPriv->grabbedDRILock = TRUE;
+
+ /* pointers so that we can prevent memory leaks later */
+ pDRIPriv->hiddenContextStore = NULL;
+ pDRIPriv->partial3DContextStore = NULL;
+
+ switch(pDRIInfo->driverSwapMethod) {
+ case DRI_HIDE_X_CONTEXT:
+ /* Server will handle 3D swaps, and hide 2D swaps from kernel.
+ * Register server context as a preserved context.
+ */
+
+ /* allocate memory for hidden context store */
+ pDRIPriv->hiddenContextStore
+ = (void *)xcalloc(1, pDRIInfo->contextSize);
+ if (!pDRIPriv->hiddenContextStore) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to allocate hidden context\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+
+ /* allocate memory for partial 3D context store */
+ pDRIPriv->partial3DContextStore
+ = (void *)xcalloc(1, pDRIInfo->contextSize);
+ if (!pDRIPriv->partial3DContextStore) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] failed to allocate partial 3D context\n");
+ xfree(pDRIPriv->hiddenContextStore);
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+
+ /* save initial context store */
+ if (pDRIInfo->SwapContext) {
+ (*pDRIInfo->SwapContext)(
+ pScreen,
+ DRI_NO_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore,
+ DRI_NO_CONTEXT,
+ NULL);
+ }
+ /* fall through */
+
+ case DRI_SERVER_SWAP:
+ /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT
+ * setup signal handler for receiving swap requests from kernel
+ */
+ if (!(pDRIPriv->drmSIGIOHandlerInstalled =
+ drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to setup DRM signal handler\n");
+ if (pDRIPriv->hiddenContextStore)
+ xfree(pDRIPriv->hiddenContextStore);
+ if (pDRIPriv->partial3DContextStore)
+ xfree(pDRIPriv->partial3DContextStore);
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ } else {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] installed DRM signal handler\n");
+ }
+
+ default:
+ break;
+ }
+
+ /* Wrap DRI support */
+ if (pDRIInfo->wrap.ValidateTree) {
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree;
+ }
+ if (pDRIInfo->wrap.PostValidateTree) {
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
+ }
+ if (pDRIInfo->wrap.WindowExposures) {
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
+ }
+ if (pDRIInfo->wrap.CopyWindow) {
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
+ }
+ if (pDRIInfo->wrap.ClipNotify) {
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
+ }
+ if (pDRIInfo->wrap.AdjustFrame) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
+ pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
+ }
+ pDRIPriv->wrapped = TRUE;
+
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n");
+
+ return TRUE;
+}
+
+void
+DRICloseScreen(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo;
+ drm_context_t * reserved;
+ int reserved_count;
+
+ if (pDRIPriv && pDRIPriv->directRenderingSupport) {
+
+ pDRIInfo = pDRIPriv->pDriverInfo;
+
+ if (pDRIPriv->wrapped) {
+ /* Unwrap DRI Functions */
+ if (pDRIInfo->wrap.ValidateTree) {
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+ pDRIPriv->wrap.ValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.PostValidateTree) {
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+ pDRIPriv->wrap.PostValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.WindowExposures) {
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+ pDRIPriv->wrap.WindowExposures = NULL;
+ }
+ if (pDRIInfo->wrap.CopyWindow) {
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+ pDRIPriv->wrap.CopyWindow = NULL;
+ }
+ if (pDRIInfo->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+ pDRIPriv->wrap.ClipNotify = NULL;
+ }
+ if (pDRIInfo->wrap.AdjustFrame) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
+ pDRIPriv->wrap.AdjustFrame = NULL;
+ }
+ pDRIPriv->wrapped = FALSE;
+ }
+
+ if (pDRIPriv->drmSIGIOHandlerInstalled) {
+ if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to remove DRM signal handler\n");
+ }
+ }
+
+ if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) {
+ DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv);
+ }
+
+ if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to destroy server context\n");
+ }
+
+ /* Remove tags for reserved contexts */
+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
+ &reserved_count))) {
+ int i;
+
+ for (i = 0; i < reserved_count; i++) {
+ DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD,
+ reserved[i]));
+ }
+ drmFreeReservedContextList(reserved);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] removed %d reserved context%s for kernel\n",
+ reserved_count, reserved_count > 1 ? "s" : "");
+ }
+
+ /* Make sure signals get unblocked etc. */
+ drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext);
+ pDRIPriv->lockRefCount = 0;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] unmapping %d bytes of SAREA %p at %p\n",
+ pDRIInfo->SAREASize,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pSAREA);
+ if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] unable to unmap %d bytes"
+ " of SAREA %p at %p\n",
+ pDRIInfo->SAREASize,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pSAREA);
+ }
+
+ drmClose(pDRIPriv->drmFD);
+
+ xfree(pDRIPriv);
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ }
+}
+
+Bool
+DRIExtensionInit(void)
+{
+ int i;
+ ScreenPtr pScreen;
+
+ if (DRIScreenPrivIndex < 0) {
+ return FALSE;
+ }
+
+ /* Allocate a window private index with a zero sized private area for
+ * each window, then should a window become a DRI window, we'll hang
+ * a DRIWindowPrivateRec off of this private index.
+ */
+ if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
+ return FALSE;
+
+ DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
+ DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete);
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ pScreen = screenInfo.screens[i];
+ if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0))
+ return FALSE;
+ }
+
+ RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
+
+ return TRUE;
+}
+
+void
+DRIReset(void)
+{
+ /*
+ * This stub routine is called when the X Server recycles, resources
+ * allocated by DRIExtensionInit need to be managed here.
+ *
+ * Currently this routine is a stub because all the interesting resources
+ * are managed via the screen init process.
+ */
+}
+
+Bool
+DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv)
+ *isCapable = pDRIPriv->directRenderingSupport;
+ else
+ *isCapable = FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *hSAREA = pDRIPriv->hSAREA;
+ *busIdString = pDRIPriv->pDriverInfo->busIdString;
+
+ return TRUE;
+}
+
+Bool
+DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
+ return TRUE;
+}
+
+Bool
+DRICloseConnection(ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+Bool
+DRIGetClientDriverName(ScreenPtr pScreen,
+ int *ddxDriverMajorVersion,
+ int *ddxDriverMinorVersion,
+ int *ddxDriverPatchVersion,
+ char **clientDriverName)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion;
+ *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion;
+ *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion;
+ *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName;
+
+ return TRUE;
+}
+
+/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper
+ functions that layer on drmCreateContext and drmAddContextTag.
+
+ DRICreateContextPriv always creates a kernel drm_context_t and then calls
+ DRICreateContextPrivFromHandle to create a DRIContextPriv structure for
+ DRI tracking. For the SIGIO handler, the drm_context_t is associated with
+ DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv
+ area and are passed to the kernel (if necessary).
+
+ DRICreateContextPriv returns a pointer to newly allocated
+ DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */
+
+DRIContextPrivPtr
+DRICreateContextPriv(ScreenPtr pScreen,
+ drm_context_t * pHWContext,
+ DRIContextFlags flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) {
+ return NULL;
+ }
+
+ return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags);
+}
+
+DRIContextPrivPtr
+DRICreateContextPrivFromHandle(ScreenPtr pScreen,
+ drm_context_t hHWContext,
+ DRIContextFlags flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIContextPrivPtr pDRIContextPriv;
+ int contextPrivSize;
+
+ contextPrivSize = sizeof(DRIContextPrivRec) +
+ pDRIPriv->pDriverInfo->contextSize;
+ if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) {
+ return NULL;
+ }
+ pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1);
+
+ drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv);
+
+ pDRIContextPriv->hwContext = hHWContext;
+ pDRIContextPriv->pScreen = pScreen;
+ pDRIContextPriv->flags = flags;
+ pDRIContextPriv->valid3D = FALSE;
+
+ if (flags & DRI_CONTEXT_2DONLY) {
+ if (drmSetContextFlags(pDRIPriv->drmFD,
+ hHWContext,
+ DRM_CONTEXT_2DONLY)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to set 2D context flag\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return NULL;
+ }
+ }
+ if (flags & DRI_CONTEXT_PRESERVED) {
+ if (drmSetContextFlags(pDRIPriv->drmFD,
+ hHWContext,
+ DRM_CONTEXT_PRESERVED)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to set preserved flag\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return NULL;
+ }
+ }
+ return pDRIContextPriv;
+}
+
+Bool
+DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv)
+{
+ DRIScreenPrivPtr pDRIPriv;
+
+ if (!pDRIContextPriv) return TRUE;
+
+ pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
+
+ if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) {
+ /* Don't delete reserved contexts from
+ kernel area -- the kernel manages its
+ reserved contexts itself. */
+ if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext))
+ return FALSE;
+ }
+
+ /* Remove the tag last to prevent a race
+ condition where the context has pending
+ buffers. The context can't be re-used
+ while in this thread, but buffers can be
+ dispatched asynchronously. */
+ drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext);
+ xfree(pDRIContextPriv);
+ return TRUE;
+}
+
+static Bool
+DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum);
+ __GLcontextModes *modes = pGLXScreen->modes;
+ void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
+ DRIContextPrivPtr pDRIContextPriv;
+ void *contextStore;
+ VisualPtr visual;
+ int visNum;
+
+ visual = pScreen->visuals;
+
+ /* Find the X visual that corresponds the the first GLX visual */
+ for (visNum = 0;
+ visNum < pScreen->numVisuals;
+ visNum++, visual++) {
+ if (modes->visualID == visual->vid)
+ break;
+ }
+ if (visNum == pScreen->numVisuals) return FALSE;
+
+ if (!(pDRIContextPriv =
+ DRICreateContextPriv(pScreen,
+ &pDRIPriv->pSAREA->dummy_context, 0))) {
+ return FALSE;
+ }
+
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) {
+ if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual,
+ pDRIPriv->pSAREA->dummy_context,
+ *pVisualConfigPriv,
+ (DRIContextType)(long)contextStore)) {
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+ }
+
+ pDRIPriv->dummyCtxPriv = pDRIContextPriv;
+ return TRUE;
+}
+
+static void
+DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv;
+ void *contextStore;
+
+ if (!pDRIContextPriv) return;
+ if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) {
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
+ pDRIContextPriv->hwContext,
+ (DRIContextType)(long)contextStore);
+ }
+
+ DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv);
+ pDRIPriv->dummyCtxPriv = NULL;
+}
+
+Bool
+DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
+ XID context, drm_context_t * pHWContext)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum);
+ __GLcontextModes *modes = pGLXScreen->modes;
+ void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
+ DRIContextPrivPtr pDRIContextPriv;
+ void *contextStore;
+
+ if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) {
+ if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] Could not create dummy context\n");
+ return FALSE;
+ }
+ }
+
+ /* Find the GLX visual associated with the one requested */
+ for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) {
+ if (modes->visualID == visual->vid)
+ break;
+ pVisualConfigPriv++;
+ }
+
+ if (modes == NULL) {
+ /* No matching GLX visual found */
+ return FALSE;
+ }
+
+ if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) {
+ return FALSE;
+ }
+
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ if (pDRIPriv->pDriverInfo->CreateContext) {
+ if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual,
+ *pHWContext, *pVisualConfigPriv,
+ (DRIContextType)(long)contextStore))) {
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+ }
+
+ /* track this in case the client dies before cleanup */
+ AddResource(context, DRIContextPrivResType, (pointer)pDRIContextPriv);
+
+ return TRUE;
+}
+
+Bool
+DRIDestroyContext(ScreenPtr pScreen, XID context)
+{
+ FreeResourceByType(context, DRIContextPrivResType, FALSE);
+
+ return TRUE;
+}
+
+/* DRIContextPrivDelete is called by the resource manager. */
+Bool
+DRIContextPrivDelete(pointer pResource, XID id)
+{
+ DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr)pResource;
+ DRIScreenPrivPtr pDRIPriv;
+ void *contextStore;
+
+ pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
+ if (pDRIPriv->pDriverInfo->DestroyContext) {
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
+ pDRIContextPriv->hwContext,
+ (DRIContextType)(long)contextStore);
+ }
+ return DRIDestroyContextPriv(pDRIContextPriv);
+}
+
+
+/* This walks the drawable timestamp array and invalidates all of them
+ * in the case of transition from private to shared backbuffers. It's
+ * not necessary for correctness, because DRIClipNotify gets called in
+ * time to prevent any conflict, but the transition from
+ * shared->private is sometimes missed if we don't do this.
+ */
+static void
+DRIClipNotifyAllDrawables(ScreenPtr pScreen)
+{
+ int i;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
+ pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++;
+ }
+}
+
+
+static void
+DRITransitionToSharedBuffers(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionSingleToMulti3D)
+ pDRIInfo->TransitionSingleToMulti3D( pScreen );
+}
+
+
+static void
+DRITransitionToPrivateBuffers(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionMultiToSingle3D)
+ pDRIInfo->TransitionMultiToSingle3D( pScreen );
+}
+
+
+static void
+DRITransitionTo3d(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionTo3d)
+ pDRIInfo->TransitionTo3d( pScreen );
+}
+
+static void
+DRITransitionTo2d(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionTo2d)
+ pDRIInfo->TransitionTo2d( pScreen );
+}
+
+
+Bool
+DRICreateDrawable(ScreenPtr pScreen, Drawable id,
+ DrawablePtr pDrawable, drm_drawable_t * hHWDrawable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+ pDRIDrawablePriv->refCount++;
+ }
+ else {
+ /* allocate a DRI Window Private record */
+ if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
+ return FALSE;
+ }
+
+ /* Only create a drm_drawable_t once */
+ if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* add it to the list of DRI drawables for this screen */
+ pDRIDrawablePriv->hwDrawable = *hHWDrawable;
+ pDRIDrawablePriv->pScreen = pScreen;
+ pDRIDrawablePriv->refCount = 1;
+ pDRIDrawablePriv->drawableIndex = -1;
+
+ /* save private off of preallocated index */
+ pWin->devPrivates[DRIWindowPrivIndex].ptr =
+ (pointer)pDRIDrawablePriv;
+
+ switch (++pDRIPriv->nrWindows) {
+ case 1:
+ DRITransitionTo3d( pScreen );
+ break;
+ case 2:
+ DRITransitionToSharedBuffers( pScreen );
+ break;
+ default:
+ break;
+ }
+
+ /* track this in case this window is destroyed */
+ AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ pDRIDrawablePriv->refCount--;
+ if (pDRIDrawablePriv->refCount <= 0) {
+ /* This calls back DRIDrawablePrivDelete which frees private area */
+ FreeResourceByType(id, DRIDrawablePrivResType, FALSE);
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDrawablePrivDelete(pointer pResource, XID id)
+{
+ DrawablePtr pDrawable = (DrawablePtr)pResource;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if (pDRIDrawablePriv->drawableIndex != -1) {
+ /* bump stamp to force outstanding 3D requests to resync */
+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
+ = DRIDrawableValidationStamp++;
+
+ /* release drawable table entry */
+ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
+ }
+
+ if (drmDestroyDrawable(pDRIPriv->drmFD,
+ pDRIDrawablePriv->hwDrawable)) {
+ return FALSE;
+ }
+ xfree(pDRIDrawablePriv);
+ pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL;
+
+ switch (--pDRIPriv->nrWindows) {
+ case 0:
+ DRITransitionTo2d( pDrawable->pScreen );
+ break;
+ case 1:
+ DRITransitionToPrivateBuffers( pDrawable->pScreen );
+ break;
+ default:
+ break;
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIGetDrawableInfo(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ unsigned int* index,
+ unsigned int* stamp,
+ int* X,
+ int* Y,
+ int* W,
+ int* H,
+ int* numClipRects,
+ drm_clip_rect_t ** pClipRects,
+ int* backX,
+ int* backY,
+ int* numBackClipRects,
+ drm_clip_rect_t ** pBackClipRects)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv;
+ WindowPtr pWin, pOldWin;
+ int i;
+
+ printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+
+ /* Manage drawable table */
+ if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */
+
+ /* Search table for empty entry */
+ i = 0;
+ while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
+ if (!(pDRIPriv->DRIDrawables[i])) {
+ pDRIPriv->DRIDrawables[i] = pDrawable;
+ pDRIDrawablePriv->drawableIndex = i;
+ pDRIPriv->pSAREA->drawableTable[i].stamp =
+ DRIDrawableValidationStamp++;
+ break;
+ }
+ i++;
+ }
+
+ /* Search table for oldest entry */
+ if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
+ unsigned int oldestStamp = ~0;
+ int oldestIndex = 0;
+ i = pDRIPriv->pDriverInfo->maxDrawableTableEntry;
+ while (i--) {
+ if (pDRIPriv->pSAREA->drawableTable[i].stamp <
+ oldestStamp) {
+ oldestIndex = i;
+ oldestStamp =
+ pDRIPriv->pSAREA->drawableTable[i].stamp;
+ }
+ }
+ pDRIDrawablePriv->drawableIndex = oldestIndex;
+
+ /* release oldest drawable table entry */
+ pOldWin = (WindowPtr)pDRIPriv->DRIDrawables[oldestIndex];
+ pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin);
+ pOldDrawPriv->drawableIndex = -1;
+
+ /* claim drawable table entry */
+ pDRIPriv->DRIDrawables[oldestIndex] = pDrawable;
+
+ /* validate SAREA entry */
+ pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp =
+ DRIDrawableValidationStamp++;
+
+ /* check for stamp wrap around */
+ if (oldestStamp > DRIDrawableValidationStamp) {
+
+ /* walk SAREA table and invalidate all drawables */
+ for( i=0;
+ i < pDRIPriv->pDriverInfo->maxDrawableTableEntry;
+ i++) {
+ pDRIPriv->pSAREA->drawableTable[i].stamp =
+ DRIDrawableValidationStamp++;
+ }
+ }
+ }
+
+ /* If the driver wants to be notified when the index is
+ * set for a drawable, let it know now.
+ */
+ if (pDRIPriv->pDriverInfo->SetDrawableIndex)
+ pDRIPriv->pDriverInfo->SetDrawableIndex(pWin,
+ pDRIDrawablePriv->drawableIndex);
+
+ /* reinit drawable ID if window is visible */
+ if ((pWin->viewable) &&
+ (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS))
+ {
+ (*pDRIPriv->pDriverInfo->InitBuffers)(pWin,
+ &pWin->clipList, pDRIDrawablePriv->drawableIndex);
+ }
+ }
+
+ *index = pDRIDrawablePriv->drawableIndex;
+ *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp;
+ *X = (int)(pWin->drawable.x);
+ *Y = (int)(pWin->drawable.y);
+#if 0
+ *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1);
+ *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+#endif
+ *W = (int)(pWin->drawable.width);
+ *H = (int)(pWin->drawable.height);
+ *numClipRects = REGION_NUM_RECTS(&pWin->clipList);
+ *pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList);
+
+ if (!*numClipRects && pDRIPriv->fullscreen) {
+ /* use fake full-screen clip rect */
+ pDRIPriv->fullscreen_rect.x1 = *X;
+ pDRIPriv->fullscreen_rect.y1 = *Y;
+ pDRIPriv->fullscreen_rect.x2 = *X + *W;
+ pDRIPriv->fullscreen_rect.y2 = *Y + *H;
+
+ *numClipRects = 1;
+ *pClipRects = &pDRIPriv->fullscreen_rect;
+ }
+
+ *backX = *X;
+ *backY = *Y;
+
+ if (pDRIPriv->nrWindows == 1 && *numClipRects) {
+ /* Use a single cliprect. */
+
+ int x0 = *X;
+ int y0 = *Y;
+ int x1 = x0 + *W;
+ int y1 = y0 + *H;
+
+ if (x0 < 0) x0 = 0;
+ if (y0 < 0) y0 = 0;
+ if (x1 > pScreen->width) x1 = pScreen->width;
+ if (y1 > pScreen->height) y1 = pScreen->height;
+
+ pDRIPriv->private_buffer_rect.x1 = x0;
+ pDRIPriv->private_buffer_rect.y1 = y0;
+ pDRIPriv->private_buffer_rect.x2 = x1;
+ pDRIPriv->private_buffer_rect.y2 = y1;
+
+ *numBackClipRects = 1;
+ *pBackClipRects = &(pDRIPriv->private_buffer_rect);
+ } else {
+ /* Use the frontbuffer cliprects for back buffers. */
+ *numBackClipRects = 0;
+ *pBackClipRects = 0;
+ }
+ }
+ else {
+ /* Not a DRIDrawable */
+ return FALSE;
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIGetDeviceInfo(ScreenPtr pScreen,
+ drm_handle_t * hFrameBuffer,
+ int* fbOrigin,
+ int* fbSize,
+ int* fbStride,
+ int* devPrivateSize,
+ void** pDevPrivate)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *hFrameBuffer = pDRIPriv->hFrameBuffer;
+ *fbOrigin = 0;
+ *fbSize = pDRIPriv->pDriverInfo->frameBufferSize;
+ *fbStride = pDRIPriv->pDriverInfo->frameBufferStride;
+ *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize;
+ *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate;
+
+ return TRUE;
+}
+
+DRIInfoPtr
+DRICreateInfoRec(void)
+{
+ DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec));
+ if (!inforec) return NULL;
+
+ /* Initialize defaults */
+ inforec->busIdString = NULL;
+
+ /* Wrapped function defaults */
+ inforec->wrap.WakeupHandler = DRIDoWakeupHandler;
+ inforec->wrap.BlockHandler = DRIDoBlockHandler;
+ inforec->wrap.WindowExposures = DRIWindowExposures;
+ inforec->wrap.CopyWindow = DRICopyWindow;
+ inforec->wrap.ValidateTree = DRIValidateTree;
+ inforec->wrap.PostValidateTree = DRIPostValidateTree;
+ inforec->wrap.ClipNotify = DRIClipNotify;
+ inforec->wrap.AdjustFrame = DRIAdjustFrame;
+
+ inforec->TransitionTo2d = 0;
+ inforec->TransitionTo3d = 0;
+ inforec->SetDrawableIndex = 0;
+
+ return inforec;
+}
+
+void
+DRIDestroyInfoRec(DRIInfoPtr DRIInfo)
+{
+ if (DRIInfo->busIdString) xfree(DRIInfo->busIdString);
+ xfree((char*)DRIInfo);
+}
+
+
+void
+DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask)
+{
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv &&
+ pDRIPriv->pDriverInfo->wrap.WakeupHandler)
+ (*pDRIPriv->pDriverInfo->wrap.WakeupHandler)(i, wakeupData,
+ result, pReadmask);
+ }
+}
+
+void
+DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
+{
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv &&
+ pDRIPriv->pDriverInfo->wrap.BlockHandler)
+ (*pDRIPriv->pDriverInfo->wrap.BlockHandler)(i, blockData,
+ pTimeout, pReadmask);
+ }
+}
+
+void
+DRIDoWakeupHandler(int screenNum, pointer wakeupData,
+ unsigned long result, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[screenNum];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ DRILock(pScreen, 0);
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_3D_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore);
+ }
+}
+
+void
+DRIDoBlockHandler(int screenNum, pointer blockData,
+ pointer pTimeout, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[screenNum];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_NO_CONTEXT,
+ NULL,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore);
+ }
+ DRIUnlock(pScreen);
+}
+
+void
+DRISwapContext(int drmFD, void *oldctx, void *newctx)
+{
+ DRIContextPrivPtr oldContext = (DRIContextPrivPtr)oldctx;
+ DRIContextPrivPtr newContext = (DRIContextPrivPtr)newctx;
+ ScreenPtr pScreen = newContext->pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ void* oldContextStore = NULL;
+ DRIContextType oldContextType;
+ void* newContextStore = NULL;
+ DRIContextType newContextType;
+ DRISyncType syncType;
+#ifdef DEBUG
+ static int count = 0;
+#endif
+
+ if (!newContext) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n",
+ oldContext, newContext);
+ return;
+ }
+
+#ifdef DEBUG
+ /* usefull for debugging, just print out after n context switches */
+ if (!count || !(count % 1)) {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[DRI] Context switch %5d from %p/0x%08x (%d)\n",
+ count,
+ oldContext,
+ oldContext ? oldContext->flags : 0,
+ oldContext ? oldContext->hwContext : -1);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[DRI] Context switch %5d to %p/0x%08x (%d)\n",
+ count,
+ newContext,
+ newContext ? newContext->flags : 0,
+ newContext ? newContext->hwContext : -1);
+ }
+ ++count;
+#endif
+
+ if (!pDRIPriv->pDriverInfo->SwapContext) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] DDX driver missing context swap call back\n");
+ return;
+ }
+
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+
+ /* only 3D contexts are swapped in this case */
+ if (oldContext) {
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ } else {
+ oldContextType = DRI_NO_CONTEXT;
+ }
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_3D_SYNC;
+ }
+ else /* default: driverSwapMethod == DRI_SERVER_SWAP */ {
+
+ /* optimize 2D context swaps */
+
+ if (newContext->flags & DRI_CONTEXT_2DONLY) {
+ /* go from 3D context to 2D context and only save 2D
+ * subset of 3D state
+ */
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContextType = DRI_2D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ newContextType = DRI_2D_CONTEXT;
+ syncType = DRI_3D_SYNC;
+ pDRIPriv->lastPartial3DContext = oldContext;
+ }
+ else if (oldContext->flags & DRI_CONTEXT_2DONLY) {
+ if (pDRIPriv->lastPartial3DContext == newContext) {
+ /* go from 2D context back to previous 3D context and
+ * only restore 2D subset of previous 3D state
+ */
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContextType = DRI_2D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ newContextType = DRI_2D_CONTEXT;
+ syncType = DRI_2D_SYNC;
+ }
+ else {
+ /* go from 2D context to a different 3D context */
+
+ /* call DDX driver to do partial restore */
+ oldContextStore = DRIGetContextStore(oldContext);
+ newContextStore =
+ DRIGetContextStore(pDRIPriv->lastPartial3DContext);
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_2D_CONTEXT,
+ oldContextStore,
+ DRI_2D_CONTEXT,
+ newContextStore);
+
+ /* now setup for a complete 3D swap */
+ oldContextStore = newContextStore;
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_NO_SYNC;
+ }
+ }
+ else {
+ /* now setup for a complete 3D swap */
+ oldContextStore = newContextStore;
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_3D_SYNC;
+ }
+ }
+
+ /* call DDX driver to perform the swap */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ syncType,
+ oldContextType,
+ oldContextStore,
+ newContextType,
+ newContextStore);
+}
+
+void*
+DRIGetContextStore(DRIContextPrivPtr context)
+{
+ return((void *)context->pContextStore);
+}
+
+void
+DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if(pDRIDrawablePriv) {
+ (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn,
+ pDRIDrawablePriv->drawableIndex);
+ }
+
+ /* call lower wrapped functions */
+ if (pDRIPriv && pDRIPriv->wrap.WindowExposures) {
+
+ /* unwrap */
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+
+ /* call lower layers */
+ (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+
+ /* rewrap */
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+ }
+}
+
+
+static int
+DRITreeTraversal(WindowPtr pWin, pointer data)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if(pDRIDrawablePriv) {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ RegionPtr reg = (RegionPtr)data;
+
+ REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
+
+ if(pDRIPriv->nrWindows == 1)
+ return WT_STOPWALKING;
+ }
+ return WT_WALKCHILDREN;
+}
+
+void
+DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if(!pDRIPriv) return;
+
+ if(pDRIPriv->nrWindows > 0) {
+ RegionRec reg;
+
+ REGION_NULL(pScreen, &reg);
+ TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
+
+ if(REGION_NOTEMPTY(pScreen, &reg)) {
+ REGION_TRANSLATE(pScreen, &reg, ptOldOrg.x - pWin->drawable.x,
+ ptOldOrg.y - pWin->drawable.y);
+ REGION_INTERSECT(pScreen, &reg, &reg, prgnSrc);
+
+ /* The MoveBuffers interface is not ideal */
+ (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, &reg,
+ pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
+ }
+
+ REGION_UNINIT(pScreen, &reg);
+ }
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.CopyWindow) {
+ /* unwrap */
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+
+ /* call lower layers */
+ (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
+
+ /* rewrap */
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+ }
+}
+
+static void
+DRIGetSecs(long *secs, long *usecs)
+{
+#ifdef XFree86LOADER
+ getsecs(secs,usecs);
+#else
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+
+ *secs = tv.tv_sec;
+ *usecs = tv.tv_usec;
+#endif
+}
+
+static unsigned long
+DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs,
+ unsigned long f_secs, unsigned long f_usecs)
+{
+ if (f_usecs < s_usecs) {
+ --f_secs;
+ f_usecs += 1000000;
+ }
+ return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000;
+}
+
+static void
+DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */)
+{
+ int count = 10000;
+#if !defined(__alpha__) && !defined(__powerpc__)
+ char ret;
+#else
+ int ret;
+#endif
+ long s_secs, s_usecs;
+ long f_secs, f_usecs;
+ long msecs;
+ long prev = 0;
+
+ DRIGetSecs(&s_secs, &s_usecs);
+
+ do {
+ DRM_SPINLOCK_COUNT(lock, val, count, ret);
+ if (!ret) return; /* Got lock */
+ DRIGetSecs(&f_secs, &f_usecs);
+ msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs);
+ if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */
+ } while (msecs < timeout);
+
+ /* Didn't get lock, so take it. The worst
+ that can happen is that there is some
+ garbage written to the wrong part of the
+ framebuffer that a refresh will repair.
+ That's undesirable, but better than
+ locking the server. This should be a
+ very rare event. */
+ DRM_SPINLOCK_TAKE(lock, val);
+}
+
+static void
+DRILockTree(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if(!pDRIPriv) return;
+
+ /* Restore the last known 3D context if the X context is hidden */
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_NO_CONTEXT,
+ NULL,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore);
+ }
+
+ /* Call kernel to release lock */
+ DRIUnlock(pScreen);
+
+ /* Grab drawable spin lock: a time out between 10 and 30 seconds is
+ appropriate, since this should never time out except in the case of
+ client death while the lock is being held. The timeout must be
+ greater than any reasonable rendering time. */
+ DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/
+
+ /* Call kernel flush outstanding buffers and relock */
+ DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
+
+ /* Switch back to our 2D context if the X context is hidden */
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_3D_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore);
+ }
+}
+
+/* It appears that somebody is relying on the lock being set even
+ if we aren't touching 3D windows */
+
+#define DRI_BROKEN
+
+static Bool DRIWindowsTouched = FALSE;
+
+int
+DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ int returnValue = 1; /* always return 1, not checked by dix/window.c */
+
+ if(!pDRIPriv) return returnValue;
+
+ DRIWindowsTouched = FALSE;
+
+#ifdef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.ValidateTree) {
+ /* unwrap */
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+
+ /* call lower layers */
+ returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+ }
+
+ return returnValue;
+}
+
+void
+DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen;
+ DRIScreenPrivPtr pDRIPriv;
+
+ if (pParent) {
+ pScreen = pParent->drawable.pScreen;
+ } else {
+ pScreen = pChild->drawable.pScreen;
+ }
+ if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return;
+
+ if (pDRIPriv->wrap.PostValidateTree) {
+ /* unwrap */
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+
+ /* call lower layers */
+ (*pScreen->PostValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = DRIPostValidateTree;
+ }
+
+ if (DRIWindowsTouched) {
+ /* Release spin lock */
+ DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1);
+ DRIWindowsTouched = FALSE;
+ }
+}
+
+void
+DRIClipNotify(WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if(!pDRIPriv) return;
+
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+
+#ifndef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
+
+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
+ = DRIDrawableValidationStamp++;
+ }
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.ClipNotify) {
+
+ /* unwrap */
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+
+ /* call lower layers */
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+
+ /* rewrap */
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+ }
+}
+
+CARD32
+DRIGetDrawableIndex(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ CARD32 index;
+
+ if (pDRIDrawablePriv) {
+ index = pDRIDrawablePriv->drawableIndex;
+ }
+ else {
+ index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry;
+ }
+
+ return index;
+}
+
+unsigned int
+DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp;
+}
+
+
+void
+DRIPrintDrawableLock(ScreenPtr pScreen, char *msg)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock);
+}
+
+void
+DRILock(ScreenPtr pScreen, int flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
+ if (!pDRIPriv->lockRefCount)
+ DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
+ pDRIPriv->lockRefCount++;
+}
+
+void
+DRIUnlock(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
+ if (pDRIPriv->lockRefCount > 0) {
+ pDRIPriv->lockRefCount--;
+ }
+ else {
+ ErrorF("DRIUnlock called when not locked\n");
+ return;
+ }
+ if (!pDRIPriv->lockRefCount)
+ DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
+}
+
+void *
+DRIGetSAREAPrivate(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if (!pDRIPriv) return 0;
+
+ return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
+}
+
+drm_context_t
+DRIGetContext(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if (!pDRIPriv) return 0;
+
+ return pDRIPriv->myContext;
+}
+
+/* This lets get at the unwrapped functions so that they can correctly
+ * call the lowerlevel functions, and choose whether they will be
+ * called at every level of recursion (eg in validatetree).
+ */
+DRIWrappedFuncsRec *
+DRIGetWrappedFuncs(ScreenPtr pScreen)
+{
+ return &(DRI_SCREEN_PRIV(pScreen)->wrap);
+}
+
+/* note that this returns the library version, not the protocol version */
+void
+DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion)
+{
+ *majorVersion = DRIINFO_MAJOR_VERSION;
+ *minorVersion = DRIINFO_MINOR_VERSION;
+ *patchVersion = DRIINFO_PATCH_VERSION;
+}
+
+static void
+_DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y)
+{
+ pDRIPriv->pSAREA->frame.x = x;
+ pDRIPriv->pSAREA->frame.y = y;
+ pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1;
+ pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1;
+}
+
+void
+DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[scrnIndex];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ int px, py;
+
+ if (!pDRIPriv || !pDRIPriv->pSAREA) {
+ DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n",
+ pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL);
+ return;
+ }
+
+ if (pDRIPriv->fullscreen) {
+ /* Fix up frame */
+ pScrn->frameX0 = pDRIPriv->pSAREA->frame.x;
+ pScrn->frameY0 = pDRIPriv->pSAREA->frame.y;
+ pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1;
+ pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1;
+
+ /* Fix up cursor */
+ miPointerPosition(&px, &py);
+ if (px < pScrn->frameX0) px = pScrn->frameX0;
+ if (px > pScrn->frameX1) px = pScrn->frameX1;
+ if (py < pScrn->frameY0) py = pScrn->frameY0;
+ if (py > pScrn->frameY1) py = pScrn->frameY1;
+ pScreen->SetCursorPosition(pScreen, px, py, TRUE);
+ return;
+ }
+
+ if (pDRIPriv->wrap.AdjustFrame) {
+ /* unwrap */
+ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
+ /* call lower layers */
+ (*pScrn->AdjustFrame)(scrnIndex, x, y, flags);
+ /* rewrap */
+ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
+ pScrn->AdjustFrame = DRIAdjustFrame;
+ }
+
+ _DRIAdjustFrame(pScrn, pDRIPriv, x, y);
+}
+
+/*
+ * DRIMoveBuffersHelper swaps the regions rects in place leaving you
+ * a region with the rects in the order that you need to blit them,
+ * but it is possibly (likely) an invalid region afterwards. If you
+ * need to use the region again for anything you have to call
+ * REGION_VALIDATE on it, or better yet, save a copy first.
+ */
+
+void
+DRIMoveBuffersHelper(
+ ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg
+)
+{
+ BoxPtr extents, pbox, firstBox, lastBox;
+ BoxRec tmpBox;
+ int y, nbox;
+
+ extents = REGION_EXTENTS(pScreen, reg);
+ nbox = REGION_NUM_RECTS(reg);
+ pbox = REGION_RECTS(reg);
+
+ if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
+ *ydir = -1;
+ if(nbox > 1) {
+ firstBox = pbox;
+ lastBox = pbox + nbox - 1;
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *ydir = 1;
+
+ if((dx > 0) && (dx < (extents->x2 - extents->x1))) {
+ *xdir = -1;
+ if(nbox > 1) {
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ while(--nbox) {
+ pbox++;
+ if(pbox->y1 == y) lastBox++;
+ else {
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ }
+ }
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *xdir = 1;
+
+}
+
+char *
+DRICreatePCIBusID(pciVideoPtr PciInfo)
+{
+ char *busID;
+ int domain;
+ PCITAG tag;
+
+ busID = xalloc(20);
+ if (busID == NULL)
+ return NULL;
+
+ tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func);
+ domain = xf86GetPciDomain(tag);
+ snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus,
+ PciInfo->device, PciInfo->func);
+ return busID;
+}
diff --git a/nx-X11/programs/Xserver/GL/dri/dri.h b/nx-X11/programs/Xserver/GL/dri/dri.h
new file mode 100644
index 000000000..312e8a8bb
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/dri.h
@@ -0,0 +1,345 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.18 2001/03/21 16:21:40 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ */
+
+/* Prototypes for DRI functions */
+
+#ifndef _DRI_H_
+
+#include "scrnintstr.h"
+#include "xf86dri.h"
+
+typedef int DRISyncType;
+
+#define DRI_NO_SYNC 0
+#define DRI_2D_SYNC 1
+#define DRI_3D_SYNC 2
+
+typedef int DRIContextType;
+
+typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
+
+typedef enum _DRIContextFlags
+{
+ DRI_CONTEXT_2DONLY = 0x01,
+ DRI_CONTEXT_PRESERVED = 0x02,
+ DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
+} DRIContextFlags;
+
+#define DRI_NO_CONTEXT 0
+#define DRI_2D_CONTEXT 1
+#define DRI_3D_CONTEXT 2
+
+typedef int DRISwapMethod;
+
+#define DRI_HIDE_X_CONTEXT 0
+#define DRI_SERVER_SWAP 1
+#define DRI_KERNEL_SWAP 2
+
+typedef int DRIWindowRequests;
+
+#define DRI_NO_WINDOWS 0
+#define DRI_3D_WINDOWS_ONLY 1
+#define DRI_ALL_WINDOWS 2
+
+
+typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
+typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags);
+
+
+/*
+ * These functions can be wrapped by the DRI. Each of these have
+ * generic default funcs (initialized in DRICreateInfoRec) and can be
+ * overridden by the driver in its [driver]DRIScreenInit function.
+ */
+typedef struct {
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+ ScreenBlockHandlerProcPtr BlockHandler;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ ClipNotifyProcPtr ClipNotify;
+ AdjustFramePtr AdjustFrame;
+} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
+
+
+/*
+ * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
+ * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
+ * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
+ * showed that this was inadequate. The DRIInfoRec structure is now versioned
+ * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
+ *
+ * Revision history:
+ * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
+ * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
+ * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer.
+ */
+
+#define DRIINFO_MAJOR_VERSION 5
+#define DRIINFO_MINOR_VERSION 0
+#define DRIINFO_PATCH_VERSION 0
+
+typedef struct {
+ /* driver call back functions
+ *
+ * New fields should be added at the end for backwards compatibility.
+ * Bump the DRIINFO patch number to indicate bugfixes.
+ * Bump the DRIINFO minor number to indicate new fields.
+ * Bump the DRIINFO major number to indicate binary-incompatible changes.
+ */
+ Bool (*CreateContext)(ScreenPtr pScreen,
+ VisualPtr visual,
+ drm_context_t hHWContext,
+ void* pVisualConfigPriv,
+ DRIContextType context);
+ void (*DestroyContext)(ScreenPtr pScreen,
+ drm_context_t hHWContext,
+ DRIContextType context);
+ void (*SwapContext)(ScreenPtr pScreen,
+ DRISyncType syncType,
+ DRIContextType readContextType,
+ void* readContextStore,
+ DRIContextType writeContextType,
+ void* writeContextStore);
+ void (*InitBuffers)(WindowPtr pWin,
+ RegionPtr prgn,
+ CARD32 indx);
+ void (*MoveBuffers)(WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc,
+ CARD32 indx);
+ void (*TransitionTo3d)(ScreenPtr pScreen);
+ void (*TransitionTo2d)(ScreenPtr pScreen);
+
+ void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx);
+ Bool (*OpenFullScreen)(ScreenPtr pScreen);
+ Bool (*CloseFullScreen)(ScreenPtr pScreen);
+
+ /* wrapped functions */
+ DRIWrappedFuncsRec wrap;
+
+ /* device info */
+ char* drmDriverName;
+ char* clientDriverName;
+ char* busIdString;
+ int ddxDriverMajorVersion;
+ int ddxDriverMinorVersion;
+ int ddxDriverPatchVersion;
+ pointer frameBufferPhysicalAddress;
+ long frameBufferSize;
+ long frameBufferStride;
+ long SAREASize;
+ int maxDrawableTableEntry;
+ int ddxDrawableTableEntry;
+ long contextSize;
+ DRISwapMethod driverSwapMethod;
+ DRIWindowRequests bufferRequests;
+ int devPrivateSize;
+ void* devPrivate;
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+
+ /* New with DRI version 4.1.0 */
+ void (*TransitionSingleToMulti3D)(ScreenPtr pScreen);
+ void (*TransitionMultiToSingle3D)(ScreenPtr pScreen);
+} DRIInfoRec, *DRIInfoPtr;
+
+
+extern Bool DRIScreenInit(ScreenPtr pScreen,
+ DRIInfoPtr pDRIInfo,
+ int *pDRMFD);
+
+extern void DRICloseScreen(ScreenPtr pScreen);
+
+extern Bool DRIExtensionInit(void);
+
+extern void DRIReset(void);
+
+extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
+ Bool *isCapable);
+
+extern Bool DRIOpenConnection(ScreenPtr pScreen,
+ drm_handle_t * hSAREA,
+ char **busIdString);
+
+extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
+
+extern Bool DRICloseConnection(ScreenPtr pScreen);
+
+extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
+ int* ddxDriverMajorVersion,
+ int* ddxDriverMinorVersion,
+ int* ddxDriverPatchVersion,
+ char** clientDriverName);
+
+extern Bool DRICreateContext(ScreenPtr pScreen,
+ VisualPtr visual,
+ XID context,
+ drm_context_t * pHWContext);
+
+extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
+
+extern Bool DRIContextPrivDelete(pointer pResource, XID id);
+
+extern Bool DRICreateDrawable(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ drm_drawable_t * hHWDrawable);
+
+extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable);
+
+extern Bool DRIDrawablePrivDelete(pointer pResource,
+ XID id);
+
+extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ unsigned int* indx,
+ unsigned int* stamp,
+ int* X,
+ int* Y,
+ int* W,
+ int* H,
+ int* numClipRects,
+ drm_clip_rect_t ** pClipRects,
+ int* backX,
+ int* backY,
+ int* numBackClipRects,
+ drm_clip_rect_t ** pBackClipRects);
+
+extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
+ drm_handle_t * hFrameBuffer,
+ int* fbOrigin,
+ int* fbSize,
+ int* fbStride,
+ int* devPrivateSize,
+ void** pDevPrivate);
+
+extern DRIInfoPtr DRICreateInfoRec(void);
+
+extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
+
+extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
+
+extern void DRIWakeupHandler(pointer wakeupData,
+ int result,
+ pointer pReadmask);
+
+extern void DRIBlockHandler(pointer blockData,
+ OSTimePtr pTimeout,
+ pointer pReadmask);
+
+extern void DRIDoWakeupHandler(int screenNum,
+ pointer wakeupData,
+ unsigned long result,
+ pointer pReadmask);
+
+extern void DRIDoBlockHandler(int screenNum,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask);
+
+extern void DRISwapContext(int drmFD,
+ void *oldctx,
+ void *newctx);
+
+extern void *DRIGetContextStore(DRIContextPrivPtr context);
+
+extern void DRIWindowExposures(WindowPtr pWin,
+ RegionPtr prgn,
+ RegionPtr bsreg);
+
+extern void DRICopyWindow(WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+
+extern int DRIValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIPostValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIClipNotify(WindowPtr pWin,
+ int dx,
+ int dy);
+
+extern CARD32 DRIGetDrawableIndex(WindowPtr pWin);
+
+extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
+
+extern void DRILock(ScreenPtr pScreen, int flags);
+
+extern void DRIUnlock(ScreenPtr pScreen);
+
+extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
+
+extern void *DRIGetSAREAPrivate(ScreenPtr pScreen);
+
+extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
+ CARD32 drawable_index);
+
+extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
+ drm_context_t * pHWContext,
+ DRIContextFlags flags);
+
+extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
+ drm_context_t hHWContext,
+ DRIContextFlags flags);
+
+extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
+
+extern drm_context_t DRIGetContext(ScreenPtr pScreen);
+
+extern void DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion);
+
+extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
+
+extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg);
+
+extern char *DRICreatePCIBusID(pciVideoPtr PciInfo);
+
+#define _DRI_H_
+
+#endif
diff --git a/nx-X11/programs/Xserver/GL/dri/drimodule.c b/nx-X11/programs/Xserver/GL/dri/drimodule.c
new file mode 100644
index 000000000..922c6f40e
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/drimodule.c
@@ -0,0 +1,127 @@
+/* $XdotOrg: xc/programs/Xserver/GL/dri/drimodule.c,v 1.6 2005/11/02 15:53:57 kem Exp $ */
+/**************************************************************************
+
+Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+/* $XFree86: xc/programs/Xserver/GL/dri/drimodule.c,v 1.5 2001/06/15 21:22:39 dawes Exp $ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Rickard E. Faith <faith@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+#include "globals.h"
+
+static MODULESETUPPROTO(driSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "dri",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+extern void XFree86DRIExtensionInit(INITARGS);
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+
+ExtensionModule XF86DRIExt =
+{
+ XFree86DRIExtensionInit,
+ XF86DRINAME,
+ &noXFree86DRIExtension,
+ NULL,
+ NULL
+};
+
+static const char *drmSymbols[] = {
+ "drmAddContextTag",
+ "drmAddMap",
+ "drmAuthMagic",
+ "drmAvailable",
+ "drmClose",
+ "drmCreateContext",
+ "drmCreateDrawable",
+ "drmDelContextTag",
+ "drmDestroyContext",
+ "drmDestroyDrawable",
+ "drmFreeReservedContextList",
+ "drmGetContextTag",
+ "drmGetLock",
+ "drmGetReservedContextList",
+ "drmInstallSIGIOHandler",
+ "drmMap",
+ "drmOpen",
+ "drmRemoveSIGIOHandler",
+ "drmSetBusid",
+ "drmSetContextFlags",
+ "drmUnlock",
+ "drmUnmap",
+ NULL
+};
+
+XF86ModuleData driModuleData = { &VersRec, driSetup, NULL };
+
+static pointer
+driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+ pointer drm = NULL;
+
+ if (!setupDone) {
+ setupDone = TRUE;
+
+ drm =
+ LoadSubModule(module, "drm", NULL, NULL, NULL, NULL, errmaj, errmin);
+
+ if (!drm) {
+ if (errmaj) *errmaj = LDR_NOSUBENT;
+ }
+ else {
+ LoaderReqSymLists(drmSymbols, NULL);
+ LoaderRefSymbols("noPanoramiXExtension", NULL);
+ LoadExtension(&XF86DRIExt, FALSE);
+ }
+ } else {
+ if (errmaj) *errmaj = LDR_ONCEONLY;
+ }
+ /* Need a non-NULL return value to indicate success */
+ return drm;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/dri/dristruct.h b/nx-X11/programs/Xserver/GL/dri/dristruct.h
new file mode 100644
index 000000000..b47afba3a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/dristruct.h
@@ -0,0 +1,105 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.12 2002/10/30 12:52:03 alanh Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ */
+
+#ifndef DRI_STRUCT_H
+#define DRI_STRUCT_H
+
+#include "xf86drm.h"
+
+
+#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
+ ((DRIWindowPrivIndex < 0) ? \
+ NULL : \
+ ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
+
+#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
+ ((DRIPixmapPrivIndex < 0) ? \
+ NULL : \
+ ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
+
+typedef struct _DRIDrawablePrivRec
+{
+ drm_drawable_t hwDrawable;
+ int drawableIndex;
+ ScreenPtr pScreen;
+ int refCount;
+} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
+
+struct _DRIContextPrivRec
+{
+ drm_context_t hwContext;
+ ScreenPtr pScreen;
+ Bool valid3D;
+ DRIContextFlags flags;
+ void** pContextStore;
+};
+
+#define DRI_SCREEN_PRIV(pScreen) \
+ ((DRIScreenPrivIndex < 0) ? \
+ NULL : \
+ ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
+
+#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
+ (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
+
+
+typedef struct _DRIScreenPrivRec
+{
+ Bool directRenderingSupport;
+ int drmFD; /* File descriptor for /dev/video/? */
+ drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
+ XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
+ drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */
+ drm_context_t myContext; /* DDX Driver's context */
+ DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
+ DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
+ void** hiddenContextStore; /* hidden X context */
+ void** partial3DContextStore; /* parital 3D context */
+ DRIInfoPtr pDriverInfo;
+ int nrWindows;
+ drm_clip_rect_t private_buffer_rect; /* management of private buffers */
+ DrawablePtr fullscreen; /* pointer to fullscreen drawable */
+ drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
+ DRIWrappedFuncsRec wrap;
+ DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
+ DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+ Bool grabbedDRILock;
+ Bool drmSIGIOHandlerInstalled;
+ Bool wrapped;
+ int lockRefCount;
+} DRIScreenPrivRec, *DRIScreenPrivPtr;
+
+#endif /* DRI_STRUCT_H */
diff --git a/nx-X11/programs/Xserver/GL/dri/sarea.h b/nx-X11/programs/Xserver/GL/dri/sarea.h
new file mode 100644
index 000000000..77c16e0ef
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/sarea.h
@@ -0,0 +1,94 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
+/**
+ * \file sarea.h
+ * SAREA definitions.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Jens Owen <jens@tungstengraphics.com>
+ * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ */
+
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
+
+#ifndef _SAREA_H_
+#define _SAREA_H_
+
+#include "xf86drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX 0x2000
+#elif defined(__ia64__)
+#define SAREA_MAX 0x10000 /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX 0x2000
+#endif
+
+#define SAREA_MAX_DRAWABLES 256
+
+#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+
+/**
+ * SAREA per drawable information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREADrawable {
+ unsigned int stamp;
+ unsigned int flags;
+} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
+
+/**
+ * SAREA frame information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREAFrame {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
+
+/**
+ * SAREA definition.
+ */
+typedef struct _XF86DRISAREA {
+ /** first thing is always the DRM locking structure */
+ drmLock lock;
+ /** \todo Use readers/writer lock for drawable_lock */
+ drmLock drawable_lock;
+ XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
+ XF86DRISAREAFrameRec frame;
+ drm_context_t dummy_context;
+} XF86DRISAREARec, *XF86DRISAREAPtr;
+
+#endif
diff --git a/nx-X11/programs/Xserver/GL/dri/xf86dri.c b/nx-X11/programs/Xserver/GL/dri/xf86dri.c
new file mode 100644
index 000000000..273ccda1b
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/dri/xf86dri.c
@@ -0,0 +1,649 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@tungstengraphics.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+#include "swaprep.h"
+#include "xf86str.h"
+#include "dri.h"
+#include "sarea.h"
+#include "dristruct.h"
+#include "xf86.h"
+#include "xf86drm.h"
+
+static int DRIErrorBase;
+
+static DISPATCH_PROC(ProcXF86DRIQueryVersion);
+static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
+static DISPATCH_PROC(ProcXF86DRIOpenConnection);
+static DISPATCH_PROC(ProcXF86DRICloseConnection);
+static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
+static DISPATCH_PROC(ProcXF86DRICreateContext);
+static DISPATCH_PROC(ProcXF86DRIDestroyContext);
+static DISPATCH_PROC(ProcXF86DRICreateDrawable);
+static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
+static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
+static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
+static DISPATCH_PROC(ProcXF86DRIDispatch);
+static DISPATCH_PROC(ProcXF86DRIAuthConnection);
+
+static DISPATCH_PROC(SProcXF86DRIQueryVersion);
+static DISPATCH_PROC(SProcXF86DRIDispatch);
+
+static void XF86DRIResetProc(ExtensionEntry* extEntry);
+
+static unsigned char DRIReqCode = 0;
+
+extern void XFree86DRIExtensionInit(void);
+
+void
+XFree86DRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+#ifdef XF86DRI_EVENTS
+ EventType = CreateNewResourceType(XF86DRIFreeEvents);
+#endif
+
+ if (
+ DRIExtensionInit() &&
+#ifdef XF86DRI_EVENTS
+ EventType && ScreenPrivateIndex != -1 &&
+#endif
+ (extEntry = AddExtension(XF86DRINAME,
+ XF86DRINumberEvents,
+ XF86DRINumberErrors,
+ ProcXF86DRIDispatch,
+ SProcXF86DRIDispatch,
+ XF86DRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ }
+}
+
+/*ARGSUSED*/
+static void
+XF86DRIResetProc (
+ ExtensionEntry* extEntry
+)
+{
+ DRIReset();
+}
+
+static int
+ProcXF86DRIQueryVersion(
+ register ClientPtr client
+)
+{
+ xXF86DRIQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = XF86DRI_MAJOR_VERSION;
+ rep.minorVersion = XF86DRI_MINOR_VERSION;
+ rep.patchVersion = XF86DRI_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ xXF86DRIQueryDirectRenderingCapableReply rep;
+ Bool isCapable;
+
+ REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
+ REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
+ &isCapable)) {
+ return BadValue;
+ }
+ rep.isCapable = isCapable;
+
+ if (!LocalClient(client))
+ rep.isCapable = 0;
+
+ WriteToClient(client,
+ sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIOpenConnection(
+ register ClientPtr client
+)
+{
+ xXF86DRIOpenConnectionReply rep;
+ drm_handle_t hSAREA;
+ char* busIdString;
+
+ REQUEST(xXF86DRIOpenConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!DRIOpenConnection( screenInfo.screens[stuff->screen],
+ &hSAREA,
+ &busIdString)) {
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.busIdStringLength = 0;
+ if (busIdString)
+ rep.busIdStringLength = strlen(busIdString);
+ rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) +
+ ((rep.busIdStringLength + 3) & ~3)) >> 2;
+
+ rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff);
+#if defined(LONG64) && !defined(__linux__)
+ rep.hSAREAHigh = (CARD32)(hSAREA >> 32);
+#else
+ rep.hSAREAHigh = 0;
+#endif
+
+ WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep);
+ if (rep.busIdStringLength)
+ WriteToClient(client, rep.busIdStringLength, busIdString);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIAuthConnection(
+ register ClientPtr client
+)
+{
+ xXF86DRIAuthConnectionReply rep;
+
+ REQUEST(xXF86DRIAuthConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.authenticated = 1;
+
+ if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
+ ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic);
+ rep.authenticated = 0;
+ }
+ WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICloseConnection(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRICloseConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ DRICloseConnection( screenInfo.screens[stuff->screen]);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetClientDriverName(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetClientDriverNameReply rep;
+ char* clientDriverName;
+
+ REQUEST(xXF86DRIGetClientDriverNameReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ DRIGetClientDriverName( screenInfo.screens[stuff->screen],
+ (int *)&rep.ddxDriverMajorVersion,
+ (int *)&rep.ddxDriverMinorVersion,
+ (int *)&rep.ddxDriverPatchVersion,
+ &clientDriverName);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.clientDriverNameLength = 0;
+ if (clientDriverName)
+ rep.clientDriverNameLength = strlen(clientDriverName);
+ rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) -
+ SIZEOF(xGenericReply) +
+ ((rep.clientDriverNameLength + 3) & ~3)) >> 2;
+
+ WriteToClient(client,
+ sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep);
+ if (rep.clientDriverNameLength)
+ WriteToClient(client,
+ rep.clientDriverNameLength,
+ clientDriverName);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICreateContext(
+ register ClientPtr client
+)
+{
+ xXF86DRICreateContextReply rep;
+ ScreenPtr pScreen;
+ VisualPtr visual;
+ int i;
+
+ REQUEST(xXF86DRICreateContextReq);
+ REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ pScreen = screenInfo.screens[stuff->screen];
+ visual = pScreen->visuals;
+
+ /* Find the requested X visual */
+ for (i = 0; i < pScreen->numVisuals; i++, visual++)
+ if (visual->vid == stuff->visual)
+ break;
+ if (i == pScreen->numVisuals) {
+ /* No visual found */
+ return BadValue;
+ }
+
+ if (!DRICreateContext( pScreen,
+ visual,
+ stuff->context,
+ (drm_context_t *)&rep.hHWContext)) {
+ return BadValue;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDestroyContext(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRIDestroyContextReq);
+ REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!DRIDestroyContext( screenInfo.screens[stuff->screen],
+ stuff->context)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICreateDrawable(
+ ClientPtr client
+)
+{
+ xXF86DRICreateDrawableReply rep;
+ DrawablePtr pDrawable;
+
+ REQUEST(xXF86DRICreateDrawableReq);
+ REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable,
+ (drm_drawable_t *)&rep.hHWDrawable)) {
+ return BadValue;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDestroyDrawable(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRIDestroyDrawableReq);
+ DrawablePtr pDrawable;
+ REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetDrawableInfo(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetDrawableInfoReply rep;
+ DrawablePtr pDrawable;
+ int X, Y, W, H;
+ drm_clip_rect_t * pClipRects;
+ drm_clip_rect_t * pBackClipRects;
+ int backX, backY;
+
+ REQUEST(xXF86DRIGetDrawableInfoReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen],
+ pDrawable,
+ (unsigned int*)&rep.drawableTableIndex,
+ (unsigned int*)&rep.drawableTableStamp,
+ (int*)&X,
+ (int*)&Y,
+ (int*)&W,
+ (int*)&H,
+ (int*)&rep.numClipRects,
+ &pClipRects,
+ &backX,
+ &backY,
+ (int*)&rep.numBackClipRects,
+ &pBackClipRects)) {
+ return BadValue;
+ }
+
+ rep.drawableX = X;
+ rep.drawableY = Y;
+ rep.drawableWidth = W;
+ rep.drawableHeight = H;
+ rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) -
+ SIZEOF(xGenericReply));
+
+ rep.backX = backX;
+ rep.backY = backY;
+
+ if (rep.numBackClipRects)
+ rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects;
+
+ if (rep.numClipRects)
+ rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
+
+ rep.length = ((rep.length + 3) & ~3) >> 2;
+
+ WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep);
+
+ if (rep.numClipRects) {
+ WriteToClient(client,
+ sizeof(drm_clip_rect_t) * rep.numClipRects,
+ (char *)pClipRects);
+ }
+
+ if (rep.numBackClipRects) {
+ WriteToClient(client,
+ sizeof(drm_clip_rect_t) * rep.numBackClipRects,
+ (char *)pBackClipRects);
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetDeviceInfo(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetDeviceInfoReply rep;
+ drm_handle_t hFrameBuffer;
+ void *pDevPrivate;
+
+ REQUEST(xXF86DRIGetDeviceInfoReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen],
+ &hFrameBuffer,
+ (int*)&rep.framebufferOrigin,
+ (int*)&rep.framebufferSize,
+ (int*)&rep.framebufferStride,
+ (int*)&rep.devPrivateSize,
+ &pDevPrivate)) {
+ return BadValue;
+ }
+
+ rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff);
+#if defined(LONG64) && !defined(__linux__)
+ rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32);
+#else
+ rep.hFrameBufferHigh = 0;
+#endif
+
+ rep.length = 0;
+ if (rep.devPrivateSize) {
+ rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) -
+ SIZEOF(xGenericReply) +
+ ((rep.devPrivateSize + 3) & ~3)) >> 2;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep);
+ if (rep.length) {
+ WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate);
+ }
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_XF86DRIQueryVersion:
+ return ProcXF86DRIQueryVersion(client);
+ case X_XF86DRIQueryDirectRenderingCapable:
+ return ProcXF86DRIQueryDirectRenderingCapable(client);
+ }
+
+ if (!LocalClient(client))
+ return DRIErrorBase + XF86DRIClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_XF86DRIOpenConnection:
+ return ProcXF86DRIOpenConnection(client);
+ case X_XF86DRICloseConnection:
+ return ProcXF86DRICloseConnection(client);
+ case X_XF86DRIGetClientDriverName:
+ return ProcXF86DRIGetClientDriverName(client);
+ case X_XF86DRICreateContext:
+ return ProcXF86DRICreateContext(client);
+ case X_XF86DRIDestroyContext:
+ return ProcXF86DRIDestroyContext(client);
+ case X_XF86DRICreateDrawable:
+ return ProcXF86DRICreateDrawable(client);
+ case X_XF86DRIDestroyDrawable:
+ return ProcXF86DRIDestroyDrawable(client);
+ case X_XF86DRIGetDrawableInfo:
+ return ProcXF86DRIGetDrawableInfo(client);
+ case X_XF86DRIGetDeviceInfo:
+ return ProcXF86DRIGetDeviceInfo(client);
+ case X_XF86DRIAuthConnection:
+ return ProcXF86DRIAuthConnection(client);
+ /* {Open,Close}FullScreen are deprecated now */
+ default:
+ return BadRequest;
+ }
+}
+
+static int
+SProcXF86DRIQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xXF86DRIQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcXF86DRIQueryVersion(client);
+}
+
+static int
+SProcXF86DRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return DRIErrorBase + XF86DRIClientNotLocal;
+
+ /* only local clients are allowed DRI access */
+ switch (stuff->data)
+ {
+ case X_XF86DRIQueryVersion:
+ return SProcXF86DRIQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile
new file mode 100644
index 000000000..5283e2286
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/Imakefile
@@ -0,0 +1,118 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.11 2004/01/28 18:11:50 alanh Exp $
+
+#if DoLoadableServer
+# if !BuildModuleInSubdir
+# define IHaveModules
+# elif !defined(IHaveModules)
+# define IHaveSubdirs
+SUBDIRS = module
+# endif
+#endif
+
+/* Large PIC tables needed for SPARC builds */
+#if defined(sparc) || defined(SparcArchitecture)
+# define LargePICTable YES
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+#include <Server.tmpl>
+
+LinkSourceFile(glcontextmodes.c, $(MESASRCDIR)/src/mesa/drivers/dri/common)
+LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common)
+LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11)
+LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11)
+
+ SRCS = global.c glxbuf.c glxcmds.c glxcmdsswap.c glxext.c \
+ glxfb.c glximports.c glxmem.c glxpix.c glxscreens.c \
+ glxutil.c render2.c render2swap.c renderpix.c \
+ renderpixswap.c rensize.c rensizetab.c single2.c \
+ single2swap.c singlepix.c singlepixswap.c \
+ singlesize.c xfont.c g_disptab.c g_disptab_EXT.c \
+ g_render.c g_renderswap.c g_single.c g_singleswap.c \
+ glcontextmodes.c indirect_size.c $(MSRCS)
+
+ OBJS = global.o glxbuf.o glxcmds.o glxcmdsswap.o glxext.o \
+ glxfb.o glximports.o glxmem.o glxpix.o glxscreens.o \
+ glxutil.o render2.o render2swap.o renderpix.o \
+ renderpixswap.o rensize.o rensizetab.o single2.o \
+ single2swap.o singlepix.o singlepixswap.o \
+ singlesize.o xfont.o g_disptab.o g_disptab_EXT.o \
+ g_render.o g_renderswap.o g_single.o g_singleswap.o \
+ glcontextmodes.o indirect_size.o $(MOBJS)
+
+ INCLUDES = -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(MESASRCDIR)/include \
+ -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \
+ -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC)
+
+#if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6)
+ NO_EXT_DEFS = -DMISSING_GL_EXTS
+#endif
+#if defined(Win32Architecture)
+# undef __stdcall
+ APIENTRY_DEFS = -DAPIENTRY=__stdcall
+#endif
+
+XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also
+XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c
+ DEFINES = $(GLX_DEFINES) $(NO_EXT_DEFS) $(APIENTRY_DEFS)
+
+
+#ifdef IHaveModules
+ModuleObjectRule()
+LibraryModuleTarget(glx,$(OBJS))
+#else
+NormalLibraryObjectRule()
+NormalLibraryTarget(glx,$(OBJS))
+#if defined(GlxUseWindows) && GlxUseWindows
+clean::
+ RemoveFiles($(foreach obj,$(OBJS), stdcall/$(obj)))
+includes::
+ MakeDir(stdcall)
+SpecialObjectRule(stdcall/%.o,%.c,-DUSE_OPENGL32 -o $@)
+NormalLibraryTarget(glx_stdcall,$(foreach obj,$(OBJS), stdcall/$(obj)))
+#endif
+#endif
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(glx,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
+#ifdef LinkDirectory
+LinkSourceFile(global.c,LinkDirectory)
+LinkSourceFile(glxbuf.c,LinkDirectory)
+LinkSourceFile(glxcmds.c,LinkDirectory)
+LinkSourceFile(glxcmdsswap.c,LinkDirectory)
+LinkSourceFile(glxext.c,LinkDirectory)
+LinkSourceFile(glxfb.c,LinkDirectory)
+LinkSourceFile(glximports.c,LinkDirectory)
+LinkSourceFile(glxmem.c,LinkDirectory)
+LinkSourceFile(glxpix.c,LinkDirectory)
+LinkSourceFile(glxscreens.c,LinkDirectory)
+LinkSourceFile(glxutil.c,LinkDirectory)
+LinkSourceFile(render2.c,LinkDirectory)
+LinkSourceFile(render2swap.c,LinkDirectory)
+LinkSourceFile(renderpix.c,LinkDirectory)
+LinkSourceFile(renderpixswap.c,LinkDirectory)
+LinkSourceFile(rensize.c,LinkDirectory)
+LinkSourceFile(rensizetab.c,LinkDirectory)
+LinkSourceFile(single2.c,LinkDirectory)
+LinkSourceFile(single2swap.c,LinkDirectory)
+LinkSourceFile(singlepix.c,LinkDirectory)
+LinkSourceFile(singlepixswap.c,LinkDirectory)
+LinkSourceFile(singlesize.c,LinkDirectory)
+LinkSourceFile(xfont.c,LinkDirectory)
+LinkSourceFile(g_disptab.c,LinkDirectory)
+LinkSourceFile(g_disptab_EXT.c,LinkDirectory)
+LinkSourceFile(g_render.c,LinkDirectory)
+LinkSourceFile(g_renderswap.c,LinkDirectory)
+LinkSourceFile(g_single.c,LinkDirectory)
+LinkSourceFile(g_singleswap.c,LinkDirectory)
+#endif
diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab.c b/nx-X11/programs/Xserver/GL/glx/g_disptab.c
new file mode 100644
index 000000000..93a9d628d
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_disptab.c
@@ -0,0 +1,839 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.5 2004/01/28 18:11:50 alanh Exp $ */
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab.h"
+__GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
+ __glXNoSuchSingleOpcode,
+ __glXRender,
+ __glXRenderLarge,
+ __glXCreateContext,
+ __glXDestroyContext,
+ __glXMakeCurrent,
+ __glXIsDirect,
+ __glXQueryVersion,
+ __glXWaitGL,
+ __glXWaitX,
+ __glXCopyContext,
+ __glXSwapBuffers,
+ __glXUseXFont,
+ __glXCreateGLXPixmap,
+ __glXGetVisualConfigs,
+ __glXDestroyGLXPixmap,
+ __glXVendorPrivate,
+ __glXVendorPrivateWithReply,
+ __glXQueryExtensionsString,
+ __glXQueryServerString,
+ __glXClientInfo,
+ __glXGetFBConfigs,
+ __glXCreatePixmap,
+ __glXDestroyGLXPixmap, /* glXDestroyPixmap */
+ __glXCreateNewContext,
+ __glXNoSuchSingleOpcode, /* glXQueryContext */
+ __glXMakeContextCurrent,
+ __glXNoSuchSingleOpcode, /* glXCreatePbuffer */
+ __glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
+ __glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
+ __glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
+ __glXNoSuchSingleOpcode, /* glXCreateWindow */
+ __glXNoSuchSingleOpcode, /* glXDestroyWindow */
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXDisp_NewList,
+ __glXDisp_EndList,
+ __glXDisp_DeleteLists,
+ __glXDisp_GenLists,
+ __glXDisp_FeedbackBuffer,
+ __glXDisp_SelectBuffer,
+ __glXDisp_RenderMode,
+ __glXDisp_Finish,
+ __glXDisp_PixelStoref,
+ __glXDisp_PixelStorei,
+ __glXDisp_ReadPixels,
+ __glXDisp_GetBooleanv,
+ __glXDisp_GetClipPlane,
+ __glXDisp_GetDoublev,
+ __glXDisp_GetError,
+ __glXDisp_GetFloatv,
+ __glXDisp_GetIntegerv,
+ __glXDisp_GetLightfv,
+ __glXDisp_GetLightiv,
+ __glXDisp_GetMapdv,
+ __glXDisp_GetMapfv,
+ __glXDisp_GetMapiv,
+ __glXDisp_GetMaterialfv,
+ __glXDisp_GetMaterialiv,
+ __glXDisp_GetPixelMapfv,
+ __glXDisp_GetPixelMapuiv,
+ __glXDisp_GetPixelMapusv,
+ __glXDisp_GetPolygonStipple,
+ __glXDisp_GetString,
+ __glXDisp_GetTexEnvfv,
+ __glXDisp_GetTexEnviv,
+ __glXDisp_GetTexGendv,
+ __glXDisp_GetTexGenfv,
+ __glXDisp_GetTexGeniv,
+ __glXDisp_GetTexImage,
+ __glXDisp_GetTexParameterfv,
+ __glXDisp_GetTexParameteriv,
+ __glXDisp_GetTexLevelParameterfv,
+ __glXDisp_GetTexLevelParameteriv,
+ __glXDisp_IsEnabled,
+ __glXDisp_IsList,
+ __glXDisp_Flush,
+ __glXDisp_AreTexturesResident,
+ __glXDisp_DeleteTextures,
+ __glXDisp_GenTextures,
+ __glXDisp_IsTexture,
+ __glXDisp_GetColorTable,
+ __glXDisp_GetColorTableParameterfv,
+ __glXDisp_GetColorTableParameteriv,
+ __glXDisp_GetConvolutionFilter,
+ __glXDisp_GetConvolutionParameterfv,
+ __glXDisp_GetConvolutionParameteriv,
+ __glXDisp_GetSeparableFilter,
+ __glXDisp_GetHistogram,
+ __glXDisp_GetHistogramParameterfv,
+ __glXDisp_GetHistogramParameteriv,
+ __glXDisp_GetMinmax,
+ __glXDisp_GetMinmaxParameterfv,
+ __glXDisp_GetMinmaxParameteriv,
+};
+
+__GLXdispatchRenderProcPtr __glXRenderTable[] = {
+ __glXNoSuchRenderOpcode,
+ __glXDisp_CallList,
+ __glXDisp_CallLists,
+ __glXDisp_ListBase,
+ __glXDisp_Begin,
+ __glXDisp_Bitmap,
+ __glXDisp_Color3bv,
+ __glXDisp_Color3dv,
+ __glXDisp_Color3fv,
+ __glXDisp_Color3iv,
+ __glXDisp_Color3sv,
+ __glXDisp_Color3ubv,
+ __glXDisp_Color3uiv,
+ __glXDisp_Color3usv,
+ __glXDisp_Color4bv,
+ __glXDisp_Color4dv,
+ __glXDisp_Color4fv,
+ __glXDisp_Color4iv,
+ __glXDisp_Color4sv,
+ __glXDisp_Color4ubv,
+ __glXDisp_Color4uiv,
+ __glXDisp_Color4usv,
+ __glXDisp_EdgeFlagv,
+ __glXDisp_End,
+ __glXDisp_Indexdv,
+ __glXDisp_Indexfv,
+ __glXDisp_Indexiv,
+ __glXDisp_Indexsv,
+ __glXDisp_Normal3bv,
+ __glXDisp_Normal3dv,
+ __glXDisp_Normal3fv,
+ __glXDisp_Normal3iv,
+ __glXDisp_Normal3sv,
+ __glXDisp_RasterPos2dv,
+ __glXDisp_RasterPos2fv,
+ __glXDisp_RasterPos2iv,
+ __glXDisp_RasterPos2sv,
+ __glXDisp_RasterPos3dv,
+ __glXDisp_RasterPos3fv,
+ __glXDisp_RasterPos3iv,
+ __glXDisp_RasterPos3sv,
+ __glXDisp_RasterPos4dv,
+ __glXDisp_RasterPos4fv,
+ __glXDisp_RasterPos4iv,
+ __glXDisp_RasterPos4sv,
+ __glXDisp_Rectdv,
+ __glXDisp_Rectfv,
+ __glXDisp_Rectiv,
+ __glXDisp_Rectsv,
+ __glXDisp_TexCoord1dv,
+ __glXDisp_TexCoord1fv,
+ __glXDisp_TexCoord1iv,
+ __glXDisp_TexCoord1sv,
+ __glXDisp_TexCoord2dv,
+ __glXDisp_TexCoord2fv,
+ __glXDisp_TexCoord2iv,
+ __glXDisp_TexCoord2sv,
+ __glXDisp_TexCoord3dv,
+ __glXDisp_TexCoord3fv,
+ __glXDisp_TexCoord3iv,
+ __glXDisp_TexCoord3sv,
+ __glXDisp_TexCoord4dv,
+ __glXDisp_TexCoord4fv,
+ __glXDisp_TexCoord4iv,
+ __glXDisp_TexCoord4sv,
+ __glXDisp_Vertex2dv,
+ __glXDisp_Vertex2fv,
+ __glXDisp_Vertex2iv,
+ __glXDisp_Vertex2sv,
+ __glXDisp_Vertex3dv,
+ __glXDisp_Vertex3fv,
+ __glXDisp_Vertex3iv,
+ __glXDisp_Vertex3sv,
+ __glXDisp_Vertex4dv,
+ __glXDisp_Vertex4fv,
+ __glXDisp_Vertex4iv,
+ __glXDisp_Vertex4sv,
+ __glXDisp_ClipPlane,
+ __glXDisp_ColorMaterial,
+ __glXDisp_CullFace,
+ __glXDisp_Fogf,
+ __glXDisp_Fogfv,
+ __glXDisp_Fogi,
+ __glXDisp_Fogiv,
+ __glXDisp_FrontFace,
+ __glXDisp_Hint,
+ __glXDisp_Lightf,
+ __glXDisp_Lightfv,
+ __glXDisp_Lighti,
+ __glXDisp_Lightiv,
+ __glXDisp_LightModelf,
+ __glXDisp_LightModelfv,
+ __glXDisp_LightModeli,
+ __glXDisp_LightModeliv,
+ __glXDisp_LineStipple,
+ __glXDisp_LineWidth,
+ __glXDisp_Materialf,
+ __glXDisp_Materialfv,
+ __glXDisp_Materiali,
+ __glXDisp_Materialiv,
+ __glXDisp_PointSize,
+ __glXDisp_PolygonMode,
+ __glXDisp_PolygonStipple,
+ __glXDisp_Scissor,
+ __glXDisp_ShadeModel,
+ __glXDisp_TexParameterf,
+ __glXDisp_TexParameterfv,
+ __glXDisp_TexParameteri,
+ __glXDisp_TexParameteriv,
+ __glXDisp_TexImage1D,
+ __glXDisp_TexImage2D,
+ __glXDisp_TexEnvf,
+ __glXDisp_TexEnvfv,
+ __glXDisp_TexEnvi,
+ __glXDisp_TexEnviv,
+ __glXDisp_TexGend,
+ __glXDisp_TexGendv,
+ __glXDisp_TexGenf,
+ __glXDisp_TexGenfv,
+ __glXDisp_TexGeni,
+ __glXDisp_TexGeniv,
+ __glXDisp_InitNames,
+ __glXDisp_LoadName,
+ __glXDisp_PassThrough,
+ __glXDisp_PopName,
+ __glXDisp_PushName,
+ __glXDisp_DrawBuffer,
+ __glXDisp_Clear,
+ __glXDisp_ClearAccum,
+ __glXDisp_ClearIndex,
+ __glXDisp_ClearColor,
+ __glXDisp_ClearStencil,
+ __glXDisp_ClearDepth,
+ __glXDisp_StencilMask,
+ __glXDisp_ColorMask,
+ __glXDisp_DepthMask,
+ __glXDisp_IndexMask,
+ __glXDisp_Accum,
+ __glXDisp_Disable,
+ __glXDisp_Enable,
+ __glXNoSuchRenderOpcode,
+ __glXDisp_PopAttrib,
+ __glXDisp_PushAttrib,
+ __glXDisp_Map1d,
+ __glXDisp_Map1f,
+ __glXDisp_Map2d,
+ __glXDisp_Map2f,
+ __glXDisp_MapGrid1d,
+ __glXDisp_MapGrid1f,
+ __glXDisp_MapGrid2d,
+ __glXDisp_MapGrid2f,
+ __glXDisp_EvalCoord1dv,
+ __glXDisp_EvalCoord1fv,
+ __glXDisp_EvalCoord2dv,
+ __glXDisp_EvalCoord2fv,
+ __glXDisp_EvalMesh1,
+ __glXDisp_EvalPoint1,
+ __glXDisp_EvalMesh2,
+ __glXDisp_EvalPoint2,
+ __glXDisp_AlphaFunc,
+ __glXDisp_BlendFunc,
+ __glXDisp_LogicOp,
+ __glXDisp_StencilFunc,
+ __glXDisp_StencilOp,
+ __glXDisp_DepthFunc,
+ __glXDisp_PixelZoom,
+ __glXDisp_PixelTransferf,
+ __glXDisp_PixelTransferi,
+ __glXDisp_PixelMapfv,
+ __glXDisp_PixelMapuiv,
+ __glXDisp_PixelMapusv,
+ __glXDisp_ReadBuffer,
+ __glXDisp_CopyPixels,
+ __glXDisp_DrawPixels,
+ __glXDisp_DepthRange,
+ __glXDisp_Frustum,
+ __glXDisp_LoadIdentity,
+ __glXDisp_LoadMatrixf,
+ __glXDisp_LoadMatrixd,
+ __glXDisp_MatrixMode,
+ __glXDisp_MultMatrixf,
+ __glXDisp_MultMatrixd,
+ __glXDisp_Ortho,
+ __glXDisp_PopMatrix,
+ __glXDisp_PushMatrix,
+ __glXDisp_Rotated,
+ __glXDisp_Rotatef,
+ __glXDisp_Scaled,
+ __glXDisp_Scalef,
+ __glXDisp_Translated,
+ __glXDisp_Translatef,
+ __glXDisp_Viewport,
+ __glXDisp_PolygonOffset,
+ __glXDisp_DrawArrays,
+ __glXDisp_Indexubv,
+ __glXDisp_ColorSubTable,
+ __glXDisp_CopyColorSubTable,
+ __glXDisp_ActiveTextureARB,
+ __glXDisp_MultiTexCoord1dvARB,
+ __glXDisp_MultiTexCoord1fvARB,
+ __glXDisp_MultiTexCoord1ivARB,
+ __glXDisp_MultiTexCoord1svARB,
+ __glXDisp_MultiTexCoord2dvARB,
+ __glXDisp_MultiTexCoord2fvARB,
+ __glXDisp_MultiTexCoord2ivARB,
+ __glXDisp_MultiTexCoord2svARB,
+ __glXDisp_MultiTexCoord3dvARB,
+ __glXDisp_MultiTexCoord3fvARB,
+ __glXDisp_MultiTexCoord3ivARB,
+ __glXDisp_MultiTexCoord3svARB,
+ __glXDisp_MultiTexCoord4dvARB,
+ __glXDisp_MultiTexCoord4fvARB,
+ __glXDisp_MultiTexCoord4ivARB,
+ __glXDisp_MultiTexCoord4svARB, /* 213 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 220 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDisp_SampleCoverageARB,
+#ifndef MISSING_GL_EXTS
+ __glXDisp_WindowPos3fARB /* 230 */
+#else
+ __glXNoSuchRenderOpcode
+#endif
+};
+
+__GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
+ __glXNoSuchSingleOpcode,
+ __glXSwapRender,
+ __glXSwapRenderLarge,
+ __glXSwapCreateContext,
+ __glXSwapDestroyContext,
+ __glXSwapMakeCurrent,
+ __glXSwapIsDirect,
+ __glXSwapQueryVersion,
+ __glXSwapWaitGL,
+ __glXSwapWaitX,
+ __glXSwapCopyContext,
+ __glXSwapSwapBuffers,
+ __glXSwapUseXFont,
+ __glXSwapCreateGLXPixmap,
+ __glXSwapGetVisualConfigs,
+ __glXSwapDestroyGLXPixmap,
+ __glXSwapVendorPrivate,
+ __glXSwapVendorPrivateWithReply,
+ __glXSwapQueryExtensionsString,
+ __glXSwapQueryServerString,
+ __glXSwapClientInfo,
+ __glXSwapGetFBConfigs,
+ __glXSwapCreatePixmap,
+ __glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
+ __glXSwapCreateNewContext,
+ __glXNoSuchSingleOpcode, /* glXQueryContext */
+ __glXSwapMakeContextCurrent,
+ __glXNoSuchSingleOpcode, /* glXCreatePbuffer */
+ __glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
+ __glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
+ __glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
+ __glXNoSuchSingleOpcode, /* glXCreateWindow */
+ __glXNoSuchSingleOpcode, /* glXDestroyWindow */
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXDispSwap_NewList,
+ __glXDispSwap_EndList,
+ __glXDispSwap_DeleteLists,
+ __glXDispSwap_GenLists,
+ __glXDispSwap_FeedbackBuffer,
+ __glXDispSwap_SelectBuffer,
+ __glXDispSwap_RenderMode,
+ __glXDispSwap_Finish,
+ __glXDispSwap_PixelStoref,
+ __glXDispSwap_PixelStorei,
+ __glXDispSwap_ReadPixels,
+ __glXDispSwap_GetBooleanv,
+ __glXDispSwap_GetClipPlane,
+ __glXDispSwap_GetDoublev,
+ __glXDispSwap_GetError,
+ __glXDispSwap_GetFloatv,
+ __glXDispSwap_GetIntegerv,
+ __glXDispSwap_GetLightfv,
+ __glXDispSwap_GetLightiv,
+ __glXDispSwap_GetMapdv,
+ __glXDispSwap_GetMapfv,
+ __glXDispSwap_GetMapiv,
+ __glXDispSwap_GetMaterialfv,
+ __glXDispSwap_GetMaterialiv,
+ __glXDispSwap_GetPixelMapfv,
+ __glXDispSwap_GetPixelMapuiv,
+ __glXDispSwap_GetPixelMapusv,
+ __glXDispSwap_GetPolygonStipple,
+ __glXDispSwap_GetString,
+ __glXDispSwap_GetTexEnvfv,
+ __glXDispSwap_GetTexEnviv,
+ __glXDispSwap_GetTexGendv,
+ __glXDispSwap_GetTexGenfv,
+ __glXDispSwap_GetTexGeniv,
+ __glXDispSwap_GetTexImage,
+ __glXDispSwap_GetTexParameterfv,
+ __glXDispSwap_GetTexParameteriv,
+ __glXDispSwap_GetTexLevelParameterfv,
+ __glXDispSwap_GetTexLevelParameteriv,
+ __glXDispSwap_IsEnabled,
+ __glXDispSwap_IsList,
+ __glXDispSwap_Flush,
+ __glXDispSwap_AreTexturesResident,
+ __glXDispSwap_DeleteTextures,
+ __glXDispSwap_GenTextures,
+ __glXDispSwap_IsTexture,
+ __glXDispSwap_GetColorTable,
+ __glXDispSwap_GetColorTableParameterfv,
+ __glXDispSwap_GetColorTableParameteriv,
+ __glXDispSwap_GetConvolutionFilter,
+ __glXDispSwap_GetConvolutionParameterfv,
+ __glXDispSwap_GetConvolutionParameteriv,
+ __glXDispSwap_GetSeparableFilter,
+ __glXDispSwap_GetHistogram,
+ __glXDispSwap_GetHistogramParameterfv,
+ __glXDispSwap_GetHistogramParameteriv,
+ __glXDispSwap_GetMinmax,
+ __glXDispSwap_GetMinmaxParameterfv,
+ __glXDispSwap_GetMinmaxParameteriv,
+};
+
+__GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_CallList,
+ __glXDispSwap_CallLists,
+ __glXDispSwap_ListBase,
+ __glXDispSwap_Begin,
+ __glXDispSwap_Bitmap,
+ __glXDispSwap_Color3bv,
+ __glXDispSwap_Color3dv,
+ __glXDispSwap_Color3fv,
+ __glXDispSwap_Color3iv,
+ __glXDispSwap_Color3sv,
+ __glXDispSwap_Color3ubv,
+ __glXDispSwap_Color3uiv,
+ __glXDispSwap_Color3usv,
+ __glXDispSwap_Color4bv,
+ __glXDispSwap_Color4dv,
+ __glXDispSwap_Color4fv,
+ __glXDispSwap_Color4iv,
+ __glXDispSwap_Color4sv,
+ __glXDispSwap_Color4ubv,
+ __glXDispSwap_Color4uiv,
+ __glXDispSwap_Color4usv,
+ __glXDispSwap_EdgeFlagv,
+ __glXDispSwap_End,
+ __glXDispSwap_Indexdv,
+ __glXDispSwap_Indexfv,
+ __glXDispSwap_Indexiv,
+ __glXDispSwap_Indexsv,
+ __glXDispSwap_Normal3bv,
+ __glXDispSwap_Normal3dv,
+ __glXDispSwap_Normal3fv,
+ __glXDispSwap_Normal3iv,
+ __glXDispSwap_Normal3sv,
+ __glXDispSwap_RasterPos2dv,
+ __glXDispSwap_RasterPos2fv,
+ __glXDispSwap_RasterPos2iv,
+ __glXDispSwap_RasterPos2sv,
+ __glXDispSwap_RasterPos3dv,
+ __glXDispSwap_RasterPos3fv,
+ __glXDispSwap_RasterPos3iv,
+ __glXDispSwap_RasterPos3sv,
+ __glXDispSwap_RasterPos4dv,
+ __glXDispSwap_RasterPos4fv,
+ __glXDispSwap_RasterPos4iv,
+ __glXDispSwap_RasterPos4sv,
+ __glXDispSwap_Rectdv,
+ __glXDispSwap_Rectfv,
+ __glXDispSwap_Rectiv,
+ __glXDispSwap_Rectsv,
+ __glXDispSwap_TexCoord1dv,
+ __glXDispSwap_TexCoord1fv,
+ __glXDispSwap_TexCoord1iv,
+ __glXDispSwap_TexCoord1sv,
+ __glXDispSwap_TexCoord2dv,
+ __glXDispSwap_TexCoord2fv,
+ __glXDispSwap_TexCoord2iv,
+ __glXDispSwap_TexCoord2sv,
+ __glXDispSwap_TexCoord3dv,
+ __glXDispSwap_TexCoord3fv,
+ __glXDispSwap_TexCoord3iv,
+ __glXDispSwap_TexCoord3sv,
+ __glXDispSwap_TexCoord4dv,
+ __glXDispSwap_TexCoord4fv,
+ __glXDispSwap_TexCoord4iv,
+ __glXDispSwap_TexCoord4sv,
+ __glXDispSwap_Vertex2dv,
+ __glXDispSwap_Vertex2fv,
+ __glXDispSwap_Vertex2iv,
+ __glXDispSwap_Vertex2sv,
+ __glXDispSwap_Vertex3dv,
+ __glXDispSwap_Vertex3fv,
+ __glXDispSwap_Vertex3iv,
+ __glXDispSwap_Vertex3sv,
+ __glXDispSwap_Vertex4dv,
+ __glXDispSwap_Vertex4fv,
+ __glXDispSwap_Vertex4iv,
+ __glXDispSwap_Vertex4sv,
+ __glXDispSwap_ClipPlane,
+ __glXDispSwap_ColorMaterial,
+ __glXDispSwap_CullFace,
+ __glXDispSwap_Fogf,
+ __glXDispSwap_Fogfv,
+ __glXDispSwap_Fogi,
+ __glXDispSwap_Fogiv,
+ __glXDispSwap_FrontFace,
+ __glXDispSwap_Hint,
+ __glXDispSwap_Lightf,
+ __glXDispSwap_Lightfv,
+ __glXDispSwap_Lighti,
+ __glXDispSwap_Lightiv,
+ __glXDispSwap_LightModelf,
+ __glXDispSwap_LightModelfv,
+ __glXDispSwap_LightModeli,
+ __glXDispSwap_LightModeliv,
+ __glXDispSwap_LineStipple,
+ __glXDispSwap_LineWidth,
+ __glXDispSwap_Materialf,
+ __glXDispSwap_Materialfv,
+ __glXDispSwap_Materiali,
+ __glXDispSwap_Materialiv,
+ __glXDispSwap_PointSize,
+ __glXDispSwap_PolygonMode,
+ __glXDispSwap_PolygonStipple,
+ __glXDispSwap_Scissor,
+ __glXDispSwap_ShadeModel,
+ __glXDispSwap_TexParameterf,
+ __glXDispSwap_TexParameterfv,
+ __glXDispSwap_TexParameteri,
+ __glXDispSwap_TexParameteriv,
+ __glXDispSwap_TexImage1D,
+ __glXDispSwap_TexImage2D,
+ __glXDispSwap_TexEnvf,
+ __glXDispSwap_TexEnvfv,
+ __glXDispSwap_TexEnvi,
+ __glXDispSwap_TexEnviv,
+ __glXDispSwap_TexGend,
+ __glXDispSwap_TexGendv,
+ __glXDispSwap_TexGenf,
+ __glXDispSwap_TexGenfv,
+ __glXDispSwap_TexGeni,
+ __glXDispSwap_TexGeniv,
+ __glXDispSwap_InitNames,
+ __glXDispSwap_LoadName,
+ __glXDispSwap_PassThrough,
+ __glXDispSwap_PopName,
+ __glXDispSwap_PushName,
+ __glXDispSwap_DrawBuffer,
+ __glXDispSwap_Clear,
+ __glXDispSwap_ClearAccum,
+ __glXDispSwap_ClearIndex,
+ __glXDispSwap_ClearColor,
+ __glXDispSwap_ClearStencil,
+ __glXDispSwap_ClearDepth,
+ __glXDispSwap_StencilMask,
+ __glXDispSwap_ColorMask,
+ __glXDispSwap_DepthMask,
+ __glXDispSwap_IndexMask,
+ __glXDispSwap_Accum,
+ __glXDispSwap_Disable,
+ __glXDispSwap_Enable,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_PopAttrib,
+ __glXDispSwap_PushAttrib,
+ __glXDispSwap_Map1d,
+ __glXDispSwap_Map1f,
+ __glXDispSwap_Map2d,
+ __glXDispSwap_Map2f,
+ __glXDispSwap_MapGrid1d,
+ __glXDispSwap_MapGrid1f,
+ __glXDispSwap_MapGrid2d,
+ __glXDispSwap_MapGrid2f,
+ __glXDispSwap_EvalCoord1dv,
+ __glXDispSwap_EvalCoord1fv,
+ __glXDispSwap_EvalCoord2dv,
+ __glXDispSwap_EvalCoord2fv,
+ __glXDispSwap_EvalMesh1,
+ __glXDispSwap_EvalPoint1,
+ __glXDispSwap_EvalMesh2,
+ __glXDispSwap_EvalPoint2,
+ __glXDispSwap_AlphaFunc,
+ __glXDispSwap_BlendFunc,
+ __glXDispSwap_LogicOp,
+ __glXDispSwap_StencilFunc,
+ __glXDispSwap_StencilOp,
+ __glXDispSwap_DepthFunc,
+ __glXDispSwap_PixelZoom,
+ __glXDispSwap_PixelTransferf,
+ __glXDispSwap_PixelTransferi,
+ __glXDispSwap_PixelMapfv,
+ __glXDispSwap_PixelMapuiv,
+ __glXDispSwap_PixelMapusv,
+ __glXDispSwap_ReadBuffer,
+ __glXDispSwap_CopyPixels,
+ __glXDispSwap_DrawPixels,
+ __glXDispSwap_DepthRange,
+ __glXDispSwap_Frustum,
+ __glXDispSwap_LoadIdentity,
+ __glXDispSwap_LoadMatrixf,
+ __glXDispSwap_LoadMatrixd,
+ __glXDispSwap_MatrixMode,
+ __glXDispSwap_MultMatrixf,
+ __glXDispSwap_MultMatrixd,
+ __glXDispSwap_Ortho,
+ __glXDispSwap_PopMatrix,
+ __glXDispSwap_PushMatrix,
+ __glXDispSwap_Rotated,
+ __glXDispSwap_Rotatef,
+ __glXDispSwap_Scaled,
+ __glXDispSwap_Scalef,
+ __glXDispSwap_Translated,
+ __glXDispSwap_Translatef,
+ __glXDispSwap_Viewport,
+ __glXDispSwap_PolygonOffset,
+ __glXDispSwap_DrawArrays,
+ __glXDispSwap_Indexubv,
+ __glXDispSwap_ColorSubTable,
+ __glXDispSwap_CopyColorSubTable,
+ __glXDispSwap_ActiveTextureARB,
+ __glXDispSwap_MultiTexCoord1dvARB,
+ __glXDispSwap_MultiTexCoord1fvARB,
+ __glXDispSwap_MultiTexCoord1ivARB,
+ __glXDispSwap_MultiTexCoord1svARB,
+ __glXDispSwap_MultiTexCoord2dvARB,
+ __glXDispSwap_MultiTexCoord2fvARB,
+ __glXDispSwap_MultiTexCoord2ivARB,
+ __glXDispSwap_MultiTexCoord2svARB,
+ __glXDispSwap_MultiTexCoord3dvARB,
+ __glXDispSwap_MultiTexCoord3fvARB,
+ __glXDispSwap_MultiTexCoord3ivARB,
+ __glXDispSwap_MultiTexCoord3svARB,
+ __glXDispSwap_MultiTexCoord4dvARB,
+ __glXDispSwap_MultiTexCoord4fvARB,
+ __glXDispSwap_MultiTexCoord4ivARB,
+ __glXDispSwap_MultiTexCoord4svARB, /* 213 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 220 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_SampleCoverageARB,
+#ifndef MISSING_GL_EXTS
+ __glXDispSwap_WindowPos3fARB /* 230 */
+#else
+ __glXNoSuchRenderOpcode
+#endif
+};
diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab.h b/nx-X11/programs/Xserver/GL/glx/g_disptab.h
new file mode 100644
index 000000000..0580b5529
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_disptab.h
@@ -0,0 +1,652 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_g_disptab_h_
+#define _GLX_g_disptab_h_
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+extern int __glXRender(__GLXclientState*, GLbyte*);
+extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
+extern int __glXCreateContext(__GLXclientState*, GLbyte*);
+extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
+extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
+extern int __glXIsDirect(__GLXclientState*, GLbyte*);
+extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
+extern int __glXWaitGL(__GLXclientState*, GLbyte*);
+extern int __glXWaitX(__GLXclientState*, GLbyte*);
+extern int __glXCopyContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
+extern int __glXUseXFont(__GLXclientState*, GLbyte*);
+extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
+extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
+extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
+extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
+extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
+extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
+extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
+extern int __glXClientInfo(__GLXclientState*, GLbyte*);
+extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
+extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
+extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
+extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
+
+extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
+extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
+extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
+extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
+extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
+extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
+extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
+extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
+extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
+extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
+extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
+extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
+extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
+extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
+extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
+
+extern void __glXDisp_CallList(GLbyte*);
+extern void __glXDisp_CallLists(GLbyte*);
+extern void __glXDisp_ListBase(GLbyte*);
+extern void __glXDisp_Begin(GLbyte*);
+extern void __glXDisp_Bitmap(GLbyte*);
+extern void __glXDisp_Color3bv(GLbyte*);
+extern void __glXDisp_Color3dv(GLbyte*);
+extern void __glXDisp_Color3fv(GLbyte*);
+extern void __glXDisp_Color3iv(GLbyte*);
+extern void __glXDisp_Color3sv(GLbyte*);
+extern void __glXDisp_Color3ubv(GLbyte*);
+extern void __glXDisp_Color3uiv(GLbyte*);
+extern void __glXDisp_Color3usv(GLbyte*);
+extern void __glXDisp_Color4bv(GLbyte*);
+extern void __glXDisp_Color4dv(GLbyte*);
+extern void __glXDisp_Color4fv(GLbyte*);
+extern void __glXDisp_Color4iv(GLbyte*);
+extern void __glXDisp_Color4sv(GLbyte*);
+extern void __glXDisp_Color4ubv(GLbyte*);
+extern void __glXDisp_Color4uiv(GLbyte*);
+extern void __glXDisp_Color4usv(GLbyte*);
+extern void __glXDisp_EdgeFlagv(GLbyte*);
+extern void __glXDisp_End(GLbyte*);
+extern void __glXDisp_Indexdv(GLbyte*);
+extern void __glXDisp_Indexfv(GLbyte*);
+extern void __glXDisp_Indexiv(GLbyte*);
+extern void __glXDisp_Indexsv(GLbyte*);
+extern void __glXDisp_Normal3bv(GLbyte*);
+extern void __glXDisp_Normal3dv(GLbyte*);
+extern void __glXDisp_Normal3fv(GLbyte*);
+extern void __glXDisp_Normal3iv(GLbyte*);
+extern void __glXDisp_Normal3sv(GLbyte*);
+extern void __glXDisp_RasterPos2dv(GLbyte*);
+extern void __glXDisp_RasterPos2fv(GLbyte*);
+extern void __glXDisp_RasterPos2iv(GLbyte*);
+extern void __glXDisp_RasterPos2sv(GLbyte*);
+extern void __glXDisp_RasterPos3dv(GLbyte*);
+extern void __glXDisp_RasterPos3fv(GLbyte*);
+extern void __glXDisp_RasterPos3iv(GLbyte*);
+extern void __glXDisp_RasterPos3sv(GLbyte*);
+extern void __glXDisp_RasterPos4dv(GLbyte*);
+extern void __glXDisp_RasterPos4fv(GLbyte*);
+extern void __glXDisp_RasterPos4iv(GLbyte*);
+extern void __glXDisp_RasterPos4sv(GLbyte*);
+extern void __glXDisp_Rectdv(GLbyte*);
+extern void __glXDisp_Rectfv(GLbyte*);
+extern void __glXDisp_Rectiv(GLbyte*);
+extern void __glXDisp_Rectsv(GLbyte*);
+extern void __glXDisp_TexCoord1dv(GLbyte*);
+extern void __glXDisp_TexCoord1fv(GLbyte*);
+extern void __glXDisp_TexCoord1iv(GLbyte*);
+extern void __glXDisp_TexCoord1sv(GLbyte*);
+extern void __glXDisp_TexCoord2dv(GLbyte*);
+extern void __glXDisp_TexCoord2fv(GLbyte*);
+extern void __glXDisp_TexCoord2iv(GLbyte*);
+extern void __glXDisp_TexCoord2sv(GLbyte*);
+extern void __glXDisp_TexCoord3dv(GLbyte*);
+extern void __glXDisp_TexCoord3fv(GLbyte*);
+extern void __glXDisp_TexCoord3iv(GLbyte*);
+extern void __glXDisp_TexCoord3sv(GLbyte*);
+extern void __glXDisp_TexCoord4dv(GLbyte*);
+extern void __glXDisp_TexCoord4fv(GLbyte*);
+extern void __glXDisp_TexCoord4iv(GLbyte*);
+extern void __glXDisp_TexCoord4sv(GLbyte*);
+extern void __glXDisp_Vertex2dv(GLbyte*);
+extern void __glXDisp_Vertex2fv(GLbyte*);
+extern void __glXDisp_Vertex2iv(GLbyte*);
+extern void __glXDisp_Vertex2sv(GLbyte*);
+extern void __glXDisp_Vertex3dv(GLbyte*);
+extern void __glXDisp_Vertex3fv(GLbyte*);
+extern void __glXDisp_Vertex3iv(GLbyte*);
+extern void __glXDisp_Vertex3sv(GLbyte*);
+extern void __glXDisp_Vertex4dv(GLbyte*);
+extern void __glXDisp_Vertex4fv(GLbyte*);
+extern void __glXDisp_Vertex4iv(GLbyte*);
+extern void __glXDisp_Vertex4sv(GLbyte*);
+extern void __glXDisp_ClipPlane(GLbyte*);
+extern void __glXDisp_ColorMaterial(GLbyte*);
+extern void __glXDisp_CullFace(GLbyte*);
+extern void __glXDisp_Fogf(GLbyte*);
+extern void __glXDisp_Fogfv(GLbyte*);
+extern void __glXDisp_Fogi(GLbyte*);
+extern void __glXDisp_Fogiv(GLbyte*);
+extern void __glXDisp_FrontFace(GLbyte*);
+extern void __glXDisp_Hint(GLbyte*);
+extern void __glXDisp_Lightf(GLbyte*);
+extern void __glXDisp_Lightfv(GLbyte*);
+extern void __glXDisp_Lighti(GLbyte*);
+extern void __glXDisp_Lightiv(GLbyte*);
+extern void __glXDisp_LightModelf(GLbyte*);
+extern void __glXDisp_LightModelfv(GLbyte*);
+extern void __glXDisp_LightModeli(GLbyte*);
+extern void __glXDisp_LightModeliv(GLbyte*);
+extern void __glXDisp_LineStipple(GLbyte*);
+extern void __glXDisp_LineWidth(GLbyte*);
+extern void __glXDisp_Materialf(GLbyte*);
+extern void __glXDisp_Materialfv(GLbyte*);
+extern void __glXDisp_Materiali(GLbyte*);
+extern void __glXDisp_Materialiv(GLbyte*);
+extern void __glXDisp_PointSize(GLbyte*);
+extern void __glXDisp_PolygonMode(GLbyte*);
+extern void __glXDisp_PolygonStipple(GLbyte*);
+extern void __glXDisp_Scissor(GLbyte*);
+extern void __glXDisp_ShadeModel(GLbyte*);
+extern void __glXDisp_TexParameterf(GLbyte*);
+extern void __glXDisp_TexParameterfv(GLbyte*);
+extern void __glXDisp_TexParameteri(GLbyte*);
+extern void __glXDisp_TexParameteriv(GLbyte*);
+extern void __glXDisp_TexImage1D(GLbyte*);
+extern void __glXDisp_TexImage2D(GLbyte*);
+extern void __glXDisp_TexEnvf(GLbyte*);
+extern void __glXDisp_TexEnvfv(GLbyte*);
+extern void __glXDisp_TexEnvi(GLbyte*);
+extern void __glXDisp_TexEnviv(GLbyte*);
+extern void __glXDisp_TexGend(GLbyte*);
+extern void __glXDisp_TexGendv(GLbyte*);
+extern void __glXDisp_TexGenf(GLbyte*);
+extern void __glXDisp_TexGenfv(GLbyte*);
+extern void __glXDisp_TexGeni(GLbyte*);
+extern void __glXDisp_TexGeniv(GLbyte*);
+extern void __glXDisp_InitNames(GLbyte*);
+extern void __glXDisp_LoadName(GLbyte*);
+extern void __glXDisp_PassThrough(GLbyte*);
+extern void __glXDisp_PopName(GLbyte*);
+extern void __glXDisp_PushName(GLbyte*);
+extern void __glXDisp_DrawBuffer(GLbyte*);
+extern void __glXDisp_Clear(GLbyte*);
+extern void __glXDisp_ClearAccum(GLbyte*);
+extern void __glXDisp_ClearIndex(GLbyte*);
+extern void __glXDisp_ClearColor(GLbyte*);
+extern void __glXDisp_ClearStencil(GLbyte*);
+extern void __glXDisp_ClearDepth(GLbyte*);
+extern void __glXDisp_StencilMask(GLbyte*);
+extern void __glXDisp_ColorMask(GLbyte*);
+extern void __glXDisp_DepthMask(GLbyte*);
+extern void __glXDisp_IndexMask(GLbyte*);
+extern void __glXDisp_Accum(GLbyte*);
+extern void __glXDisp_Disable(GLbyte*);
+extern void __glXDisp_Enable(GLbyte*);
+extern void __glXDisp_PopAttrib(GLbyte*);
+extern void __glXDisp_PushAttrib(GLbyte*);
+extern void __glXDisp_Map1d(GLbyte*);
+extern void __glXDisp_Map1f(GLbyte*);
+extern void __glXDisp_Map2d(GLbyte*);
+extern void __glXDisp_Map2f(GLbyte*);
+extern void __glXDisp_MapGrid1d(GLbyte*);
+extern void __glXDisp_MapGrid1f(GLbyte*);
+extern void __glXDisp_MapGrid2d(GLbyte*);
+extern void __glXDisp_MapGrid2f(GLbyte*);
+extern void __glXDisp_EvalCoord1dv(GLbyte*);
+extern void __glXDisp_EvalCoord1fv(GLbyte*);
+extern void __glXDisp_EvalCoord2dv(GLbyte*);
+extern void __glXDisp_EvalCoord2fv(GLbyte*);
+extern void __glXDisp_EvalMesh1(GLbyte*);
+extern void __glXDisp_EvalPoint1(GLbyte*);
+extern void __glXDisp_EvalMesh2(GLbyte*);
+extern void __glXDisp_EvalPoint2(GLbyte*);
+extern void __glXDisp_AlphaFunc(GLbyte*);
+extern void __glXDisp_BlendFunc(GLbyte*);
+extern void __glXDisp_LogicOp(GLbyte*);
+extern void __glXDisp_StencilFunc(GLbyte*);
+extern void __glXDisp_StencilOp(GLbyte*);
+extern void __glXDisp_DepthFunc(GLbyte*);
+extern void __glXDisp_PixelZoom(GLbyte*);
+extern void __glXDisp_PixelTransferf(GLbyte*);
+extern void __glXDisp_PixelTransferi(GLbyte*);
+extern void __glXDisp_PixelMapfv(GLbyte*);
+extern void __glXDisp_PixelMapuiv(GLbyte*);
+extern void __glXDisp_PixelMapusv(GLbyte*);
+extern void __glXDisp_ReadBuffer(GLbyte*);
+extern void __glXDisp_CopyPixels(GLbyte*);
+extern void __glXDisp_DrawPixels(GLbyte*);
+extern void __glXDisp_DepthRange(GLbyte*);
+extern void __glXDisp_Frustum(GLbyte*);
+extern void __glXDisp_LoadIdentity(GLbyte*);
+extern void __glXDisp_LoadMatrixf(GLbyte*);
+extern void __glXDisp_LoadMatrixd(GLbyte*);
+extern void __glXDisp_MatrixMode(GLbyte*);
+extern void __glXDisp_MultMatrixf(GLbyte*);
+extern void __glXDisp_MultMatrixd(GLbyte*);
+extern void __glXDisp_Ortho(GLbyte*);
+extern void __glXDisp_PopMatrix(GLbyte*);
+extern void __glXDisp_PushMatrix(GLbyte*);
+extern void __glXDisp_Rotated(GLbyte*);
+extern void __glXDisp_Rotatef(GLbyte*);
+extern void __glXDisp_Scaled(GLbyte*);
+extern void __glXDisp_Scalef(GLbyte*);
+extern void __glXDisp_Translated(GLbyte*);
+extern void __glXDisp_Translatef(GLbyte*);
+extern void __glXDisp_Viewport(GLbyte*);
+extern void __glXDisp_PolygonOffset(GLbyte*);
+extern void __glXDisp_DrawArrays(GLbyte*);
+extern void __glXDisp_Indexubv(GLbyte*);
+extern void __glXDisp_ColorSubTable(GLbyte*);
+extern void __glXDisp_CopyColorSubTable(GLbyte*);
+extern void __glXDisp_ActiveTextureARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
+extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDisp_SampleCoverageARB(GLbyte *);
+extern void __glXDisp_WindowPos3fARB(GLbyte *);
+
+extern int __glXSwapRender(__GLXclientState*, GLbyte*);
+extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
+extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
+extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
+extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
+extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
+extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
+extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
+extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
+extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
+extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
+extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
+extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
+extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
+extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
+extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
+extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
+extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
+
+extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
+
+extern void __glXDispSwap_CallList(GLbyte*);
+extern void __glXDispSwap_CallLists(GLbyte*);
+extern void __glXDispSwap_ListBase(GLbyte*);
+extern void __glXDispSwap_Begin(GLbyte*);
+extern void __glXDispSwap_Bitmap(GLbyte*);
+extern void __glXDispSwap_Color3bv(GLbyte*);
+extern void __glXDispSwap_Color3dv(GLbyte*);
+extern void __glXDispSwap_Color3fv(GLbyte*);
+extern void __glXDispSwap_Color3iv(GLbyte*);
+extern void __glXDispSwap_Color3sv(GLbyte*);
+extern void __glXDispSwap_Color3ubv(GLbyte*);
+extern void __glXDispSwap_Color3uiv(GLbyte*);
+extern void __glXDispSwap_Color3usv(GLbyte*);
+extern void __glXDispSwap_Color4bv(GLbyte*);
+extern void __glXDispSwap_Color4dv(GLbyte*);
+extern void __glXDispSwap_Color4fv(GLbyte*);
+extern void __glXDispSwap_Color4iv(GLbyte*);
+extern void __glXDispSwap_Color4sv(GLbyte*);
+extern void __glXDispSwap_Color4ubv(GLbyte*);
+extern void __glXDispSwap_Color4uiv(GLbyte*);
+extern void __glXDispSwap_Color4usv(GLbyte*);
+extern void __glXDispSwap_EdgeFlagv(GLbyte*);
+extern void __glXDispSwap_End(GLbyte*);
+extern void __glXDispSwap_Indexdv(GLbyte*);
+extern void __glXDispSwap_Indexfv(GLbyte*);
+extern void __glXDispSwap_Indexiv(GLbyte*);
+extern void __glXDispSwap_Indexsv(GLbyte*);
+extern void __glXDispSwap_Normal3bv(GLbyte*);
+extern void __glXDispSwap_Normal3dv(GLbyte*);
+extern void __glXDispSwap_Normal3fv(GLbyte*);
+extern void __glXDispSwap_Normal3iv(GLbyte*);
+extern void __glXDispSwap_Normal3sv(GLbyte*);
+extern void __glXDispSwap_RasterPos2dv(GLbyte*);
+extern void __glXDispSwap_RasterPos2fv(GLbyte*);
+extern void __glXDispSwap_RasterPos2iv(GLbyte*);
+extern void __glXDispSwap_RasterPos2sv(GLbyte*);
+extern void __glXDispSwap_RasterPos3dv(GLbyte*);
+extern void __glXDispSwap_RasterPos3fv(GLbyte*);
+extern void __glXDispSwap_RasterPos3iv(GLbyte*);
+extern void __glXDispSwap_RasterPos3sv(GLbyte*);
+extern void __glXDispSwap_RasterPos4dv(GLbyte*);
+extern void __glXDispSwap_RasterPos4fv(GLbyte*);
+extern void __glXDispSwap_RasterPos4iv(GLbyte*);
+extern void __glXDispSwap_RasterPos4sv(GLbyte*);
+extern void __glXDispSwap_Rectdv(GLbyte*);
+extern void __glXDispSwap_Rectfv(GLbyte*);
+extern void __glXDispSwap_Rectiv(GLbyte*);
+extern void __glXDispSwap_Rectsv(GLbyte*);
+extern void __glXDispSwap_TexCoord1dv(GLbyte*);
+extern void __glXDispSwap_TexCoord1fv(GLbyte*);
+extern void __glXDispSwap_TexCoord1iv(GLbyte*);
+extern void __glXDispSwap_TexCoord1sv(GLbyte*);
+extern void __glXDispSwap_TexCoord2dv(GLbyte*);
+extern void __glXDispSwap_TexCoord2fv(GLbyte*);
+extern void __glXDispSwap_TexCoord2iv(GLbyte*);
+extern void __glXDispSwap_TexCoord2sv(GLbyte*);
+extern void __glXDispSwap_TexCoord3dv(GLbyte*);
+extern void __glXDispSwap_TexCoord3fv(GLbyte*);
+extern void __glXDispSwap_TexCoord3iv(GLbyte*);
+extern void __glXDispSwap_TexCoord3sv(GLbyte*);
+extern void __glXDispSwap_TexCoord4dv(GLbyte*);
+extern void __glXDispSwap_TexCoord4fv(GLbyte*);
+extern void __glXDispSwap_TexCoord4iv(GLbyte*);
+extern void __glXDispSwap_TexCoord4sv(GLbyte*);
+extern void __glXDispSwap_Vertex2dv(GLbyte*);
+extern void __glXDispSwap_Vertex2fv(GLbyte*);
+extern void __glXDispSwap_Vertex2iv(GLbyte*);
+extern void __glXDispSwap_Vertex2sv(GLbyte*);
+extern void __glXDispSwap_Vertex3dv(GLbyte*);
+extern void __glXDispSwap_Vertex3fv(GLbyte*);
+extern void __glXDispSwap_Vertex3iv(GLbyte*);
+extern void __glXDispSwap_Vertex3sv(GLbyte*);
+extern void __glXDispSwap_Vertex4dv(GLbyte*);
+extern void __glXDispSwap_Vertex4fv(GLbyte*);
+extern void __glXDispSwap_Vertex4iv(GLbyte*);
+extern void __glXDispSwap_Vertex4sv(GLbyte*);
+extern void __glXDispSwap_ClipPlane(GLbyte*);
+extern void __glXDispSwap_ColorMaterial(GLbyte*);
+extern void __glXDispSwap_CullFace(GLbyte*);
+extern void __glXDispSwap_Fogf(GLbyte*);
+extern void __glXDispSwap_Fogfv(GLbyte*);
+extern void __glXDispSwap_Fogi(GLbyte*);
+extern void __glXDispSwap_Fogiv(GLbyte*);
+extern void __glXDispSwap_FrontFace(GLbyte*);
+extern void __glXDispSwap_Hint(GLbyte*);
+extern void __glXDispSwap_Lightf(GLbyte*);
+extern void __glXDispSwap_Lightfv(GLbyte*);
+extern void __glXDispSwap_Lighti(GLbyte*);
+extern void __glXDispSwap_Lightiv(GLbyte*);
+extern void __glXDispSwap_LightModelf(GLbyte*);
+extern void __glXDispSwap_LightModelfv(GLbyte*);
+extern void __glXDispSwap_LightModeli(GLbyte*);
+extern void __glXDispSwap_LightModeliv(GLbyte*);
+extern void __glXDispSwap_LineStipple(GLbyte*);
+extern void __glXDispSwap_LineWidth(GLbyte*);
+extern void __glXDispSwap_Materialf(GLbyte*);
+extern void __glXDispSwap_Materialfv(GLbyte*);
+extern void __glXDispSwap_Materiali(GLbyte*);
+extern void __glXDispSwap_Materialiv(GLbyte*);
+extern void __glXDispSwap_PointSize(GLbyte*);
+extern void __glXDispSwap_PolygonMode(GLbyte*);
+extern void __glXDispSwap_PolygonStipple(GLbyte*);
+extern void __glXDispSwap_Scissor(GLbyte*);
+extern void __glXDispSwap_ShadeModel(GLbyte*);
+extern void __glXDispSwap_TexParameterf(GLbyte*);
+extern void __glXDispSwap_TexParameterfv(GLbyte*);
+extern void __glXDispSwap_TexParameteri(GLbyte*);
+extern void __glXDispSwap_TexParameteriv(GLbyte*);
+extern void __glXDispSwap_TexImage1D(GLbyte*);
+extern void __glXDispSwap_TexImage2D(GLbyte*);
+extern void __glXDispSwap_TexEnvf(GLbyte*);
+extern void __glXDispSwap_TexEnvfv(GLbyte*);
+extern void __glXDispSwap_TexEnvi(GLbyte*);
+extern void __glXDispSwap_TexEnviv(GLbyte*);
+extern void __glXDispSwap_TexGend(GLbyte*);
+extern void __glXDispSwap_TexGendv(GLbyte*);
+extern void __glXDispSwap_TexGenf(GLbyte*);
+extern void __glXDispSwap_TexGenfv(GLbyte*);
+extern void __glXDispSwap_TexGeni(GLbyte*);
+extern void __glXDispSwap_TexGeniv(GLbyte*);
+extern void __glXDispSwap_InitNames(GLbyte*);
+extern void __glXDispSwap_LoadName(GLbyte*);
+extern void __glXDispSwap_PassThrough(GLbyte*);
+extern void __glXDispSwap_PopName(GLbyte*);
+extern void __glXDispSwap_PushName(GLbyte*);
+extern void __glXDispSwap_DrawBuffer(GLbyte*);
+extern void __glXDispSwap_Clear(GLbyte*);
+extern void __glXDispSwap_ClearAccum(GLbyte*);
+extern void __glXDispSwap_ClearIndex(GLbyte*);
+extern void __glXDispSwap_ClearColor(GLbyte*);
+extern void __glXDispSwap_ClearStencil(GLbyte*);
+extern void __glXDispSwap_ClearDepth(GLbyte*);
+extern void __glXDispSwap_StencilMask(GLbyte*);
+extern void __glXDispSwap_ColorMask(GLbyte*);
+extern void __glXDispSwap_DepthMask(GLbyte*);
+extern void __glXDispSwap_IndexMask(GLbyte*);
+extern void __glXDispSwap_Accum(GLbyte*);
+extern void __glXDispSwap_Disable(GLbyte*);
+extern void __glXDispSwap_Enable(GLbyte*);
+extern void __glXDispSwap_PopAttrib(GLbyte*);
+extern void __glXDispSwap_PushAttrib(GLbyte*);
+extern void __glXDispSwap_Map1d(GLbyte*);
+extern void __glXDispSwap_Map1f(GLbyte*);
+extern void __glXDispSwap_Map2d(GLbyte*);
+extern void __glXDispSwap_Map2f(GLbyte*);
+extern void __glXDispSwap_MapGrid1d(GLbyte*);
+extern void __glXDispSwap_MapGrid1f(GLbyte*);
+extern void __glXDispSwap_MapGrid2d(GLbyte*);
+extern void __glXDispSwap_MapGrid2f(GLbyte*);
+extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
+extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
+extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
+extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
+extern void __glXDispSwap_EvalMesh1(GLbyte*);
+extern void __glXDispSwap_EvalPoint1(GLbyte*);
+extern void __glXDispSwap_EvalMesh2(GLbyte*);
+extern void __glXDispSwap_EvalPoint2(GLbyte*);
+extern void __glXDispSwap_AlphaFunc(GLbyte*);
+extern void __glXDispSwap_BlendFunc(GLbyte*);
+extern void __glXDispSwap_LogicOp(GLbyte*);
+extern void __glXDispSwap_StencilFunc(GLbyte*);
+extern void __glXDispSwap_StencilOp(GLbyte*);
+extern void __glXDispSwap_DepthFunc(GLbyte*);
+extern void __glXDispSwap_PixelZoom(GLbyte*);
+extern void __glXDispSwap_PixelTransferf(GLbyte*);
+extern void __glXDispSwap_PixelTransferi(GLbyte*);
+extern void __glXDispSwap_PixelMapfv(GLbyte*);
+extern void __glXDispSwap_PixelMapuiv(GLbyte*);
+extern void __glXDispSwap_PixelMapusv(GLbyte*);
+extern void __glXDispSwap_ReadBuffer(GLbyte*);
+extern void __glXDispSwap_CopyPixels(GLbyte*);
+extern void __glXDispSwap_DrawPixels(GLbyte*);
+extern void __glXDispSwap_DepthRange(GLbyte*);
+extern void __glXDispSwap_Frustum(GLbyte*);
+extern void __glXDispSwap_LoadIdentity(GLbyte*);
+extern void __glXDispSwap_LoadMatrixf(GLbyte*);
+extern void __glXDispSwap_LoadMatrixd(GLbyte*);
+extern void __glXDispSwap_MatrixMode(GLbyte*);
+extern void __glXDispSwap_MultMatrixf(GLbyte*);
+extern void __glXDispSwap_MultMatrixd(GLbyte*);
+extern void __glXDispSwap_Ortho(GLbyte*);
+extern void __glXDispSwap_PopMatrix(GLbyte*);
+extern void __glXDispSwap_PushMatrix(GLbyte*);
+extern void __glXDispSwap_Rotated(GLbyte*);
+extern void __glXDispSwap_Rotatef(GLbyte*);
+extern void __glXDispSwap_Scaled(GLbyte*);
+extern void __glXDispSwap_Scalef(GLbyte*);
+extern void __glXDispSwap_Translated(GLbyte*);
+extern void __glXDispSwap_Translatef(GLbyte*);
+extern void __glXDispSwap_Viewport(GLbyte*);
+extern void __glXDispSwap_PolygonOffset(GLbyte*);
+extern void __glXDispSwap_DrawArrays(GLbyte*);
+extern void __glXDispSwap_Indexubv(GLbyte*);
+extern void __glXDispSwap_ColorSubTable(GLbyte*);
+extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
+extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
+extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDispSwap_SampleCoverageARB(GLbyte *);
+extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
+
+#define __GLX_MIN_GLXCMD_OPCODE 1
+#define __GLX_MAX_GLXCMD_OPCODE 20
+#define __GLX_MIN_RENDER_OPCODE 1
+/*#define __GLX_MAX_RENDER_OPCODE 213*/
+#define __GLX_MAX_RENDER_OPCODE 230
+#define __GLX_MIN_SINGLE_OPCODE 1
+#define __GLX_MAX_SINGLE_OPCODE 159
+#define __GLX_SINGLE_TABLE_SIZE 160
+/*#define __GLX_RENDER_TABLE_SIZE 214*/
+#define __GLX_RENDER_TABLE_SIZE 231
+extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
+extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
+extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
+extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
+#endif /* _GLX_g_disptab_h_ */
diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c
new file mode 100644
index 000000000..d837c64d9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c
@@ -0,0 +1,4447 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.c,v 1.5 2004/01/28 18:11:50 alanh Exp $ */
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab_EXT.h"
+__GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ __glXDisp_ColorTable, /* 2053 */
+ __glXDisp_ColorTableParameterfv, /* 2054 */
+ __glXDisp_ColorTableParameteriv,
+ __glXDisp_CopyColorTable,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2060 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#ifndef MISSING_GL_EXTS
+ __glXDisp_PointParameterfARB, /* 2065 */
+ __glXDisp_PointParameterfvARB, /* 2066 */
+#else
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#endif
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2070 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDisp_BlendColor, /* 4096 */
+ __glXDisp_BlendEquation, /* 4097 */
+ __glXNoSuchRenderOpcode, /* 4098 */
+ __glXDisp_TexSubImage1D, /* 4099 */
+ __glXDisp_TexSubImage2D, /* 4100 */
+ __glXDisp_ConvolutionFilter1D,
+ __glXDisp_ConvolutionFilter2D,
+ __glXDisp_ConvolutionParameterf,
+ __glXDisp_ConvolutionParameterfv,
+ __glXDisp_ConvolutionParameteri,
+ __glXDisp_ConvolutionParameteriv,
+ __glXDisp_CopyConvolutionFilter1D,
+ __glXDisp_CopyConvolutionFilter2D,
+ __glXDisp_SeparableFilter2D,
+ __glXDisp_Histogram, /* 4110 */
+ __glXDisp_Minmax,
+ __glXDisp_ResetHistogram,
+ __glXDisp_ResetMinmax,
+ __glXDisp_TexImage3D,
+ __glXDisp_TexSubImage3D,
+ __glXDisp_DrawArraysEXT,
+ __glXDisp_BindTexture,
+ __glXDisp_PrioritizeTextures,
+ __glXDisp_CopyTexImage1D,
+ __glXDisp_CopyTexImage2D, /* 4120 */
+ __glXDisp_CopyTexSubImage1D, /* 4121 */
+ __glXDisp_CopyTexSubImage2D, /* 4122 */
+ __glXDisp_CopyTexSubImage3D, /* 4123 */
+#ifndef MISSING_GL_EXTS
+ __glXDisp_FogCoordfv, /* 4124 */
+ __glXDisp_FogCoorddv, /* 4125 */
+ __glXDisp_SecondaryColor3bv, /* 4126 */
+ __glXDisp_SecondaryColor3sv, /* 4127 */
+ __glXDisp_SecondaryColor3iv, /* 4128 */
+ __glXDisp_SecondaryColor3fv, /* 4129 */
+ __glXDisp_SecondaryColor3dv, /* 4130 */
+ __glXDisp_SecondaryColor3ubv, /* 4131 */
+ __glXDisp_SecondaryColor3usv, /* 4132 */
+ __glXDisp_SecondaryColor3uiv, /* 4133 */
+ __glXDisp_BlendFuncSeparate, /* 4134 */
+#else
+ __glXNoSuchRenderOpcode, /* 4124 */
+ __glXNoSuchRenderOpcode, /* 4125 */
+ __glXNoSuchRenderOpcode, /* 4126 */
+ __glXNoSuchRenderOpcode, /* 4127 */
+ __glXNoSuchRenderOpcode, /* 4128 */
+ __glXNoSuchRenderOpcode, /* 4129 */
+ __glXNoSuchRenderOpcode, /* 4130 */
+ __glXNoSuchRenderOpcode, /* 4131 */
+ __glXNoSuchRenderOpcode, /* 4132 */
+ __glXNoSuchRenderOpcode, /* 4133 */
+ __glXNoSuchRenderOpcode, /* 4134 */
+#endif
+ __glXNoSuchRenderOpcode, /* 4135 */
+ __glXNoSuchRenderOpcode, /* 4136 */
+ __glXNoSuchRenderOpcode, /* 4137 */
+ __glXNoSuchRenderOpcode, /* 4138 */
+ __glXNoSuchRenderOpcode, /* 4139 */
+ __glXNoSuchRenderOpcode, /* 4140 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4150 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4160 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4170 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4180 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4190 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4200 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4210 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4219 */
+#ifndef MISSING_GL_EXTS
+ __glXDisp_ActiveStencilFaceEXT, /* 4220 */
+ __glXDisp_PointParameteriNV, /* 4221 */
+ __glXDisp_PointParameterivNV, /* 4222 */
+#else
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#endif
+};
+__GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
+ __glXDisp_AreTexturesResidentEXT, /* 11 */
+ __glXDisp_DeleteTexturesEXT, /* 12 */
+ __glXDisp_GenTexturesEXT, /* 13 */
+ __glXDisp_IsTextureEXT, /* 14 */
+};
+
+
+__GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ __glXDispSwap_ColorTable, /* 2053 */
+ __glXDispSwap_ColorTableParameterfv, /* 2054 */
+ __glXDispSwap_ColorTableParameteriv,
+ __glXDispSwap_CopyColorTable,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2060 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#ifndef MISSING_GL_EXTS
+ __glXDispSwap_PointParameterfARB, /* 2065 */
+ __glXDispSwap_PointParameterfvARB, /* 2066 */
+#else
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#endif
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 2070 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_BlendColor,
+ __glXDispSwap_BlendEquation,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_TexSubImage1D,
+ __glXDispSwap_TexSubImage2D,
+ __glXDispSwap_ConvolutionFilter1D,
+ __glXDispSwap_ConvolutionFilter2D,
+ __glXDispSwap_ConvolutionParameterf,
+ __glXDispSwap_ConvolutionParameterfv,
+ __glXDispSwap_ConvolutionParameteri,
+ __glXDispSwap_ConvolutionParameteriv,
+ __glXDispSwap_CopyConvolutionFilter1D,
+ __glXDispSwap_CopyConvolutionFilter2D,
+ __glXDispSwap_SeparableFilter2D,
+ __glXDispSwap_Histogram,
+ __glXDispSwap_Minmax,
+ __glXDispSwap_ResetHistogram,
+ __glXDispSwap_ResetMinmax,
+ __glXDispSwap_TexImage3D,
+ __glXDispSwap_TexSubImage3D,
+ __glXDispSwap_DrawArraysEXT,
+ __glXDispSwap_BindTexture,
+ __glXDispSwap_PrioritizeTextures,
+ __glXDispSwap_CopyTexImage1D,
+ __glXDispSwap_CopyTexImage2D, /* 4120 */
+ __glXDispSwap_CopyTexSubImage1D, /* 4121 */
+ __glXDispSwap_CopyTexSubImage2D, /* 4122 */
+ __glXDispSwap_CopyTexSubImage3D, /* 4123 */
+#ifndef MISSING_GL_EXTS
+ __glXDispSwap_FogCoordfv, /* 4124 */
+ __glXDispSwap_FogCoorddv, /* 4125 */
+ __glXDispSwap_SecondaryColor3bv, /* 4126 */
+ __glXDispSwap_SecondaryColor3sv, /* 4127 */
+ __glXDispSwap_SecondaryColor3iv, /* 4128 */
+ __glXDispSwap_SecondaryColor3fv, /* 4129 */
+ __glXDispSwap_SecondaryColor3dv, /* 4130 */
+ __glXDispSwap_SecondaryColor3ubv, /* 4131 */
+ __glXDispSwap_SecondaryColor3usv, /* 4132 */
+ __glXDispSwap_SecondaryColor3uiv, /* 4133 */
+ __glXDisp_BlendFuncSeparate, /* 4134 */
+#else
+ __glXNoSuchRenderOpcode, /* 4124 */
+ __glXNoSuchRenderOpcode, /* 4125 */
+ __glXNoSuchRenderOpcode, /* 4126 */
+ __glXNoSuchRenderOpcode, /* 4127 */
+ __glXNoSuchRenderOpcode, /* 4128 */
+ __glXNoSuchRenderOpcode, /* 4129 */
+ __glXNoSuchRenderOpcode, /* 4130 */
+ __glXNoSuchRenderOpcode, /* 4131 */
+ __glXNoSuchRenderOpcode, /* 4132 */
+ __glXNoSuchRenderOpcode, /* 4133 */
+ __glXNoSuchRenderOpcode, /* 4134 */
+#endif
+ __glXNoSuchRenderOpcode, /* 4135 */
+ __glXNoSuchRenderOpcode, /* 4136 */
+ __glXNoSuchRenderOpcode, /* 4137 */
+ __glXNoSuchRenderOpcode, /* 4138 */
+ __glXNoSuchRenderOpcode, /* 4139 */
+ __glXNoSuchRenderOpcode, /* 4140 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4150 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4160 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4170 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4180 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4190 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4200 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4210 */
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode, /* 4219 */
+#ifndef MISSING_GL_EXTS
+ __glXDispSwap_ActiveStencilFaceEXT, /* 4220 */
+ __glXDispSwap_PointParameteriNV, /* 4221 */
+ __glXDispSwap_PointParameterivNV, /* 4222 */
+#else
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+ __glXNoSuchRenderOpcode,
+#endif
+};
+__GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
+ __glXDispSwap_AreTexturesResidentEXT, /* 11 */
+ __glXDispSwap_DeleteTexturesEXT, /* 12 */
+ __glXDispSwap_GenTexturesEXT, /* 13 */
+ __glXDispSwap_IsTextureEXT, /* 14 */
+};
+
diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h
new file mode 100644
index 000000000..3def7f1c5
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h
@@ -0,0 +1,159 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.5 2004/01/28 18:11:50 alanh Exp $ */
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_g_disptab_EXT_h_
+#define _GLX_g_disptab_EXT_h_
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+extern int __glXDisp_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
+extern int __glXDisp_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
+extern int __glXDisp_GenTexturesEXT(__GLXclientState*, GLbyte*);
+extern int __glXDisp_IsTextureEXT(__GLXclientState*, GLbyte*);
+
+extern void __glXDisp_ColorTable(GLbyte*);
+extern void __glXDisp_ColorTableParameterfv(GLbyte*);
+extern void __glXDisp_ColorTableParameteriv(GLbyte*);
+extern void __glXDisp_CopyColorTable(GLbyte*);
+extern void __glXDisp_BlendColor(GLbyte*);
+extern void __glXDisp_BlendEquation(GLbyte*);
+extern void __glXDisp_TexSubImage1D(GLbyte*);
+extern void __glXDisp_TexSubImage2D(GLbyte*);
+extern void __glXDisp_ConvolutionFilter1D(GLbyte*);
+extern void __glXDisp_ConvolutionFilter2D(GLbyte*);
+extern void __glXDisp_ConvolutionParameterf(GLbyte*);
+extern void __glXDisp_ConvolutionParameterfv(GLbyte*);
+extern void __glXDisp_ConvolutionParameteri(GLbyte*);
+extern void __glXDisp_ConvolutionParameteriv(GLbyte*);
+extern void __glXDisp_CopyConvolutionFilter1D(GLbyte*);
+extern void __glXDisp_CopyConvolutionFilter2D(GLbyte*);
+extern void __glXDisp_SeparableFilter2D(GLbyte*);
+extern void __glXDisp_Histogram(GLbyte*);
+extern void __glXDisp_Minmax(GLbyte*);
+extern void __glXDisp_ResetHistogram(GLbyte*);
+extern void __glXDisp_ResetMinmax(GLbyte*);
+extern void __glXDisp_TexImage3D(GLbyte*);
+extern void __glXDisp_TexSubImage3D(GLbyte*);
+extern void __glXDisp_DrawArraysEXT(GLbyte*);
+extern void __glXDisp_BindTexture(GLbyte*);
+extern void __glXDisp_PrioritizeTextures(GLbyte*);
+extern void __glXDisp_CopyTexImage1D(GLbyte*);
+extern void __glXDisp_CopyTexImage2D(GLbyte*);
+extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
+extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
+extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
+extern void __glXDisp_PointParameterfARB(GLbyte*);
+extern void __glXDisp_PointParameterfvARB(GLbyte*);
+
+extern void __glXDisp_FogCoordfv(GLbyte *);
+extern void __glXDisp_FogCoorddv(GLbyte *);
+extern void __glXDispSwap_FogCoordfv(GLbyte *);
+extern void __glXDispSwap_FogCoorddv(GLbyte *);
+
+extern void __glXDisp_SecondaryColor3bv(GLbyte *);
+extern void __glXDisp_SecondaryColor3sv(GLbyte *);
+extern void __glXDisp_SecondaryColor3iv(GLbyte *);
+extern void __glXDisp_SecondaryColor3ubv(GLbyte *);
+extern void __glXDisp_SecondaryColor3usv(GLbyte *);
+extern void __glXDisp_SecondaryColor3uiv(GLbyte *);
+extern void __glXDisp_SecondaryColor3fv(GLbyte *);
+extern void __glXDisp_SecondaryColor3dv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3bv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3sv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3iv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3ubv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3usv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3uiv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3fv(GLbyte *);
+extern void __glXDispSwap_SecondaryColor3dv(GLbyte *);
+
+extern void __glXDisp_BlendFuncSeparate(GLbyte *);
+extern void __glXDispSwap_BlendFuncSeparate(GLbyte *);
+
+extern void __glXDisp_PointParameteriNV(GLbyte *);
+extern void __glXDisp_PointParameterivNV(GLbyte *);
+extern void __glXDispSwap_PointParameteriNV(GLbyte *);
+extern void __glXDispSwap_PointParameterivNV(GLbyte *);
+
+extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
+
+extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_GenTexturesEXT(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_IsTextureEXT(__GLXclientState*, GLbyte*);
+
+extern void __glXDispSwap_ColorTable(GLbyte*);
+extern void __glXDispSwap_ColorTableParameterfv(GLbyte*);
+extern void __glXDispSwap_ColorTableParameteriv(GLbyte*);
+extern void __glXDispSwap_CopyColorTable(GLbyte*);
+extern void __glXDispSwap_BlendColor(GLbyte*);
+extern void __glXDispSwap_BlendEquation(GLbyte*);
+extern void __glXDispSwap_TexSubImage1D(GLbyte*);
+extern void __glXDispSwap_TexSubImage2D(GLbyte*);
+extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
+extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
+extern void __glXDispSwap_ConvolutionParameterf(GLbyte*);
+extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
+extern void __glXDispSwap_ConvolutionParameteri(GLbyte*);
+extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
+extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
+extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
+extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
+extern void __glXDispSwap_Histogram(GLbyte*);
+extern void __glXDispSwap_Minmax(GLbyte*);
+extern void __glXDispSwap_ResetHistogram(GLbyte*);
+extern void __glXDispSwap_ResetMinmax(GLbyte*);
+extern void __glXDispSwap_TexImage3D(GLbyte*);
+extern void __glXDispSwap_TexSubImage3D(GLbyte*);
+extern void __glXDispSwap_DrawArraysEXT(GLbyte*);
+extern void __glXDispSwap_BindTexture(GLbyte*);
+extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
+extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
+extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
+extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
+extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
+extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
+extern void __glXDispSwap_PointParameterfARB(GLbyte*);
+extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
+extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
+
+#define __GLX_MIN_RENDER_OPCODE_EXT 2053
+#define __GLX_MAX_RENDER_OPCODE_EXT 4222
+#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
+#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
+#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
+#define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
+extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
+extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
+extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
+extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
+#endif /* _GLX_g_disptab_EXT_h_ */
diff --git a/nx-X11/programs/Xserver/GL/glx/g_render.c b/nx-X11/programs/Xserver/GL/glx/g_render.c
new file mode 100644
index 000000000..24c64897e
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_render.c
@@ -0,0 +1,2282 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_render.c,v 1.8 2004/02/03 21:34:36 alanh Exp $ */
+/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "unpack.h"
+#include "impsize.h"
+#include "singlesize.h"
+
+void __glXDisp_CallList(GLbyte *pc)
+{
+ glCallList(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_ListBase(GLbyte *pc)
+{
+ glListBase(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Begin(GLbyte *pc)
+{
+ glBegin(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+#define __GLX_SWAP_GLbyte(ptr)
+#define __GLX_SWAP_GLshort(ptr) __GLX_SWAP_SHORT(ptr)
+#define __GLX_SWAP_GLint(ptr) __GLX_SWAP_INT(ptr)
+#define __GLX_SWAP_GLubyte(ptr)
+#define __GLX_SWAP_GLushort(ptr) __GLX_SWAP_SHORT(ptr)
+#define __GLX_SWAP_GLuint(ptr) __GLX_SWAP_INT(ptr)
+#define __GLX_SWAP_GLdouble(ptr) __GLX_SWAP_DOUBLE(ptr)
+#define __GLX_SWAP_GLfloat(ptr) __GLX_SWAP_FLOAT(ptr)
+
+#define __GLX_SWAP_GLbyte_ARRAY(ptr,count) (void) swapEnd; (void) swapPC; (void) sw;
+#define __GLX_SWAP_GLshort_ARRAY(ptr,count) __GLX_SWAP_SHORT_ARRAY(ptr,count)
+#define __GLX_SWAP_GLint_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
+#define __GLX_SWAP_GLenum_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
+#define __GLX_SWAP_GLubyte_ARRAY(ptr,count) (void) swapEnd; (void) swapPC; (void) sw;
+#define __GLX_SWAP_GLushort_ARRAY(ptr,count) __GLX_SWAP_SHORT_ARRAY(ptr,count)
+#define __GLX_SWAP_GLuint_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
+#define __GLX_SWAP_GLdouble_ARRAY(ptr,count) __GLX_SWAP_DOUBLE_ARRAY(ptr,count)
+#define __GLX_SWAP_GLfloat_ARRAY(ptr,count) __GLX_SWAP_FLOAT_ARRAY(ptr,count)
+
+#ifdef __GLX_ALIGN64
+/* If type is not GLdouble, the compiler should optimize this away.
+ */
+# define GLX_DO_ALIGN_MAGIC(count, type) \
+ do { \
+ if ( (sizeof(type) == 8) && ((unsigned long)(pc) & 7)) \
+ { \
+ __GLX_MEM_COPY(pc-4, pc, (count * sizeof( type ) )); \
+ pc -= 4; \
+ } \
+ } while( 0 )
+#else
+# define GLX_DO_ALIGN_MAGIC(count, type)
+#endif
+
+#define dispatch_template_1( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ GLX_DO_ALIGN_MAGIC( 1, type ); \
+ gl ## name ( (type *) pc ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ GLX_DO_ALIGN_MAGIC( 1, type ); \
+ __GLX_SWAP_ ## type ( pc ); \
+ gl ## name ( (type *) pc ); \
+ }
+
+#define dispatch_template_3( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ GLX_DO_ALIGN_MAGIC( 3, type ); \
+ gl ## name ( (type *) pc ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
+ GLX_DO_ALIGN_MAGIC( 3, type ); \
+ __GLX_SWAP_ ## type ## _ARRAY(pc, 3); \
+ gl ## name ( (type *) pc ); \
+ }
+
+#define dispatch_template_4( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ GLX_DO_ALIGN_MAGIC( 4, type ); \
+ gl ## name ( (type *) pc ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
+ GLX_DO_ALIGN_MAGIC( 4, type ); \
+ __GLX_SWAP_ ## type ## _ARRAY(pc, 4); \
+ gl ## name ( (type *) pc ); \
+ }
+
+#define dispatch_template_4s( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ GLX_DO_ALIGN_MAGIC( 4, type ); \
+ gl ## name ( ((type *) pc)[0], ((type *) pc)[1], \
+ ((type *) pc)[2], ((type *) pc)[3] ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
+ GLX_DO_ALIGN_MAGIC( 4, type ); \
+ __GLX_SWAP_ ## type ## _ARRAY(pc, 4); \
+ gl ## name ( ((type *) pc)[0], ((type *) pc)[1], \
+ ((type *) pc)[2], ((type *) pc)[3] ); \
+ }
+
+/**
+ * \bug All of the enum1 templates need to be updated to handle the case where
+ * \c type is \c GLdouble. When the type is a double, the data comes before
+ * the enum. This is also the reason the invocation of the
+ * \c GLX_DO_ALIGN_MAGIC macro was removed.
+ */
+#define dispatch_template_enum1_1s( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ gl ## name ( *(GLenum *) (pc + 0), \
+ *(type *) (pc + 4) ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ __GLX_SWAP_INT (pc + 0); \
+ __GLX_SWAP_ ## type (pc + 4); \
+ gl ## name ( *(GLenum *) (pc + 0), \
+ *(type *) (pc + 4) ); \
+ }
+
+#define dispatch_template_enum1_Vv( name, type ) \
+ void __glXDisp_ ## name ( GLbyte * pc ) \
+ { \
+ gl ## name ( *(GLenum *) (pc + 0), \
+ (type *) (pc + 4) ); \
+ } \
+ void __glXDispSwap_ ## name ( GLbyte * pc ) \
+ { \
+ GLenum pname; GLint compsize; \
+ __GLX_DECLARE_SWAP_VARIABLES; \
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
+ __GLX_SWAP_INT(pc + 0); \
+ pname = *(GLenum *)(pc + 0); \
+ compsize = __gl ## name ## _size(pname); \
+ if (compsize < 0) compsize = 0; \
+ __GLX_SWAP_ ## type ## _ARRAY(pc + 4, compsize); \
+ gl ## name ( *(GLenum *) (pc + 0), \
+ (type *) (pc + 4) ); \
+ }
+
+#ifndef MISSING_GL_EXTS
+dispatch_template_1( FogCoordfv, GLfloat )
+dispatch_template_1( FogCoorddv, GLdouble )
+dispatch_template_3( SecondaryColor3bv, GLbyte )
+dispatch_template_3( SecondaryColor3sv, GLshort )
+dispatch_template_3( SecondaryColor3iv, GLint )
+dispatch_template_3( SecondaryColor3ubv, GLubyte )
+dispatch_template_3( SecondaryColor3usv, GLushort )
+dispatch_template_3( SecondaryColor3uiv, GLuint )
+dispatch_template_3( SecondaryColor3fv, GLfloat )
+dispatch_template_3( SecondaryColor3dv, GLdouble )
+
+dispatch_template_4s( BlendFuncSeparate, GLenum )
+#endif /* !MISSING_GL_EXTS */
+
+void __glXDisp_Color3bv(GLbyte *pc)
+{
+ glColor3bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glColor3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3fv(GLbyte *pc)
+{
+ glColor3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3iv(GLbyte *pc)
+{
+ glColor3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3sv(GLbyte *pc)
+{
+ glColor3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3ubv(GLbyte *pc)
+{
+ glColor3ubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3uiv(GLbyte *pc)
+{
+ glColor3uiv(
+ (GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color3usv(GLbyte *pc)
+{
+ glColor3usv(
+ (GLushort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4bv(GLbyte *pc)
+{
+ glColor4bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glColor4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4fv(GLbyte *pc)
+{
+ glColor4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4iv(GLbyte *pc)
+{
+ glColor4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4sv(GLbyte *pc)
+{
+ glColor4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4ubv(GLbyte *pc)
+{
+ glColor4ubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4uiv(GLbyte *pc)
+{
+ glColor4uiv(
+ (GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Color4usv(GLbyte *pc)
+{
+ glColor4usv(
+ (GLushort *)(pc + 0)
+ );
+}
+
+void __glXDisp_EdgeFlagv(GLbyte *pc)
+{
+ glEdgeFlagv(
+ (GLboolean *)(pc + 0)
+ );
+}
+
+void __glXDisp_End(GLbyte *pc)
+{
+ glEnd(
+ );
+}
+
+void __glXDisp_Indexdv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ glIndexdv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Indexfv(GLbyte *pc)
+{
+ glIndexfv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Indexiv(GLbyte *pc)
+{
+ glIndexiv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Indexsv(GLbyte *pc)
+{
+ glIndexsv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Normal3bv(GLbyte *pc)
+{
+ glNormal3bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_Normal3dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glNormal3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Normal3fv(GLbyte *pc)
+{
+ glNormal3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Normal3iv(GLbyte *pc)
+{
+ glNormal3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Normal3sv(GLbyte *pc)
+{
+ glNormal3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos2dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glRasterPos2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos2fv(GLbyte *pc)
+{
+ glRasterPos2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos2iv(GLbyte *pc)
+{
+ glRasterPos2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos2sv(GLbyte *pc)
+{
+ glRasterPos2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos3dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glRasterPos3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos3fv(GLbyte *pc)
+{
+ glRasterPos3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos3iv(GLbyte *pc)
+{
+ glRasterPos3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos3sv(GLbyte *pc)
+{
+ glRasterPos3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos4dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glRasterPos4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos4fv(GLbyte *pc)
+{
+ glRasterPos4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos4iv(GLbyte *pc)
+{
+ glRasterPos4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_RasterPos4sv(GLbyte *pc)
+{
+ glRasterPos4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Rectdv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glRectdv(
+ (GLdouble *)(pc + 0),
+ (GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDisp_Rectfv(GLbyte *pc)
+{
+ glRectfv(
+ (GLfloat *)(pc + 0),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Rectiv(GLbyte *pc)
+{
+ glRectiv(
+ (GLint *)(pc + 0),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_Rectsv(GLbyte *pc)
+{
+ glRectsv(
+ (GLshort *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDisp_TexCoord1dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ glTexCoord1dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord1fv(GLbyte *pc)
+{
+ glTexCoord1fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord1iv(GLbyte *pc)
+{
+ glTexCoord1iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord1sv(GLbyte *pc)
+{
+ glTexCoord1sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord2dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glTexCoord2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord2fv(GLbyte *pc)
+{
+ glTexCoord2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord2iv(GLbyte *pc)
+{
+ glTexCoord2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord2sv(GLbyte *pc)
+{
+ glTexCoord2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord3dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glTexCoord3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord3fv(GLbyte *pc)
+{
+ glTexCoord3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord3iv(GLbyte *pc)
+{
+ glTexCoord3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord3sv(GLbyte *pc)
+{
+ glTexCoord3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord4dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glTexCoord4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord4fv(GLbyte *pc)
+{
+ glTexCoord4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord4iv(GLbyte *pc)
+{
+ glTexCoord4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexCoord4sv(GLbyte *pc)
+{
+ glTexCoord4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex2dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glVertex2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex2fv(GLbyte *pc)
+{
+ glVertex2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex2iv(GLbyte *pc)
+{
+ glVertex2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex2sv(GLbyte *pc)
+{
+ glVertex2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex3dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glVertex3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex3fv(GLbyte *pc)
+{
+ glVertex3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex3iv(GLbyte *pc)
+{
+ glVertex3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex3sv(GLbyte *pc)
+{
+ glVertex3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex4dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glVertex4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex4fv(GLbyte *pc)
+{
+ glVertex4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex4iv(GLbyte *pc)
+{
+ glVertex4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Vertex4sv(GLbyte *pc)
+{
+ glVertex4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDisp_ClipPlane(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 36);
+ pc -= 4;
+ }
+#endif
+ glClipPlane(
+ *(GLenum *)(pc + 32),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_ColorMaterial(GLbyte *pc)
+{
+ glColorMaterial(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDisp_CullFace(GLbyte *pc)
+{
+ glCullFace(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_Fogf(GLbyte *pc)
+{
+ glFogf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_Fogfv(GLbyte *pc)
+{
+ glFogfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_Fogi(GLbyte *pc)
+{
+ glFogi(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_Fogiv(GLbyte *pc)
+{
+ glFogiv(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_FrontFace(GLbyte *pc)
+{
+ glFrontFace(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_Hint(GLbyte *pc)
+{
+ glHint(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDisp_Lightf(GLbyte *pc)
+{
+ glLightf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Lightfv(GLbyte *pc)
+{
+ glLightfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Lighti(GLbyte *pc)
+{
+ glLighti(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_Lightiv(GLbyte *pc)
+{
+ glLightiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_LightModelf(GLbyte *pc)
+{
+ glLightModelf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_LightModelfv(GLbyte *pc)
+{
+ glLightModelfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_LightModeli(GLbyte *pc)
+{
+ glLightModeli(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_LightModeliv(GLbyte *pc)
+{
+ glLightModeliv(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_LineStipple(GLbyte *pc)
+{
+ glLineStipple(
+ *(GLint *)(pc + 0),
+ *(GLushort *)(pc + 4)
+ );
+}
+
+void __glXDisp_LineWidth(GLbyte *pc)
+{
+ glLineWidth(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_Materialf(GLbyte *pc)
+{
+ glMaterialf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Materialfv(GLbyte *pc)
+{
+ glMaterialfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Materiali(GLbyte *pc)
+{
+ glMateriali(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_Materialiv(GLbyte *pc)
+{
+ glMaterialiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_PointSize(GLbyte *pc)
+{
+ glPointSize(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_PolygonMode(GLbyte *pc)
+{
+ glPolygonMode(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDisp_Scissor(GLbyte *pc)
+{
+ glScissor(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12)
+ );
+}
+
+void __glXDisp_ShadeModel(GLbyte *pc)
+{
+ glShadeModel(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexParameterf(GLbyte *pc)
+{
+ glTexParameterf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexParameterfv(GLbyte *pc)
+{
+ glTexParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexParameteri(GLbyte *pc)
+{
+ glTexParameteri(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexParameteriv(GLbyte *pc)
+{
+ glTexParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexEnvf(GLbyte *pc)
+{
+ glTexEnvf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexEnvfv(GLbyte *pc)
+{
+ glTexEnvfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexEnvi(GLbyte *pc)
+{
+ glTexEnvi(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexEnviv(GLbyte *pc)
+{
+ glTexEnviv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexGend(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glTexGend(
+ *(GLenum *)(pc + 8),
+ *(GLenum *)(pc + 12),
+ *(GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_TexGendv(GLbyte *pc)
+{
+#ifdef __GLX_ALIGN64
+ GLenum pname;
+ GLint cmdlen;
+ GLint compsize;
+
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexGendv_size(pname);
+ if (compsize < 0) compsize = 0;
+ cmdlen = __GLX_PAD(8+compsize*8);
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, cmdlen);
+ pc -= 4;
+ }
+#endif
+
+ glTexGendv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexGenf(GLbyte *pc)
+{
+ glTexGenf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexGenfv(GLbyte *pc)
+{
+ glTexGenfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexGeni(GLbyte *pc)
+{
+ glTexGeni(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_TexGeniv(GLbyte *pc)
+{
+ glTexGeniv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_InitNames(GLbyte *pc)
+{
+ glInitNames(
+ );
+}
+
+void __glXDisp_LoadName(GLbyte *pc)
+{
+ glLoadName(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_PassThrough(GLbyte *pc)
+{
+ glPassThrough(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_PopName(GLbyte *pc)
+{
+ glPopName(
+ );
+}
+
+void __glXDisp_PushName(GLbyte *pc)
+{
+ glPushName(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_DrawBuffer(GLbyte *pc)
+{
+ glDrawBuffer(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_Clear(GLbyte *pc)
+{
+ glClear(
+ *(GLbitfield *)(pc + 0)
+ );
+}
+
+void __glXDisp_ClearAccum(GLbyte *pc)
+{
+ glClearAccum(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLfloat *)(pc + 12)
+ );
+}
+
+void __glXDisp_ClearIndex(GLbyte *pc)
+{
+ glClearIndex(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_ClearColor(GLbyte *pc)
+{
+ glClearColor(
+ *(GLclampf *)(pc + 0),
+ *(GLclampf *)(pc + 4),
+ *(GLclampf *)(pc + 8),
+ *(GLclampf *)(pc + 12)
+ );
+}
+
+void __glXDisp_ClearStencil(GLbyte *pc)
+{
+ glClearStencil(
+ *(GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_ClearDepth(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ glClearDepth(
+ *(GLclampd *)(pc + 0)
+ );
+}
+
+void __glXDisp_StencilMask(GLbyte *pc)
+{
+ glStencilMask(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_ColorMask(GLbyte *pc)
+{
+ glColorMask(
+ *(GLboolean *)(pc + 0),
+ *(GLboolean *)(pc + 1),
+ *(GLboolean *)(pc + 2),
+ *(GLboolean *)(pc + 3)
+ );
+}
+
+void __glXDisp_DepthMask(GLbyte *pc)
+{
+ glDepthMask(
+ *(GLboolean *)(pc + 0)
+ );
+}
+
+void __glXDisp_IndexMask(GLbyte *pc)
+{
+ glIndexMask(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDisp_Accum(GLbyte *pc)
+{
+ glAccum(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_Disable(GLbyte *pc)
+{
+ glDisable(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_Enable(GLbyte *pc)
+{
+ glEnable(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_PopAttrib(GLbyte *pc)
+{
+ glPopAttrib(
+ );
+}
+
+void __glXDisp_PushAttrib(GLbyte *pc)
+{
+ glPushAttrib(
+ *(GLbitfield *)(pc + 0)
+ );
+}
+
+void __glXDisp_MapGrid1d(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 20);
+ pc -= 4;
+ }
+#endif
+ glMapGrid1d(
+ *(GLint *)(pc + 16),
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8)
+ );
+}
+
+void __glXDisp_MapGrid1f(GLbyte *pc)
+{
+ glMapGrid1f(
+ *(GLint *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_MapGrid2d(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 40);
+ pc -= 4;
+ }
+#endif
+ glMapGrid2d(
+ *(GLint *)(pc + 32),
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLint *)(pc + 36),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24)
+ );
+}
+
+void __glXDisp_MapGrid2f(GLbyte *pc)
+{
+ glMapGrid2f(
+ *(GLint *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLfloat *)(pc + 16),
+ *(GLfloat *)(pc + 20)
+ );
+}
+
+void __glXDisp_EvalCoord1dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ glEvalCoord1dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_EvalCoord1fv(GLbyte *pc)
+{
+ glEvalCoord1fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_EvalCoord2dv(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glEvalCoord2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_EvalCoord2fv(GLbyte *pc)
+{
+ glEvalCoord2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_EvalMesh1(GLbyte *pc)
+{
+ glEvalMesh1(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_EvalPoint1(GLbyte *pc)
+{
+ glEvalPoint1(
+ *(GLint *)(pc + 0)
+ );
+}
+
+void __glXDisp_EvalMesh2(GLbyte *pc)
+{
+ glEvalMesh2(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16)
+ );
+}
+
+void __glXDisp_EvalPoint2(GLbyte *pc)
+{
+ glEvalPoint2(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_AlphaFunc(GLbyte *pc)
+{
+ glAlphaFunc(
+ *(GLenum *)(pc + 0),
+ *(GLclampf *)(pc + 4)
+ );
+}
+
+void __glXDisp_BlendFunc(GLbyte *pc)
+{
+ glBlendFunc(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDisp_LogicOp(GLbyte *pc)
+{
+ glLogicOp(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_StencilFunc(GLbyte *pc)
+{
+ glStencilFunc(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLuint *)(pc + 8)
+ );
+}
+
+void __glXDisp_StencilOp(GLbyte *pc)
+{
+ glStencilOp(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8)
+ );
+}
+
+void __glXDisp_DepthFunc(GLbyte *pc)
+{
+ glDepthFunc(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_PixelZoom(GLbyte *pc)
+{
+ glPixelZoom(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_PixelTransferf(GLbyte *pc)
+{
+ glPixelTransferf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_PixelTransferi(GLbyte *pc)
+{
+ glPixelTransferi(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_PixelMapfv(GLbyte *pc)
+{
+ glPixelMapfv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_PixelMapuiv(GLbyte *pc)
+{
+ glPixelMapuiv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLuint *)(pc + 8)
+ );
+}
+
+void __glXDisp_PixelMapusv(GLbyte *pc)
+{
+ glPixelMapusv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLushort *)(pc + 8)
+ );
+}
+
+void __glXDisp_ReadBuffer(GLbyte *pc)
+{
+ glReadBuffer(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_CopyPixels(GLbyte *pc)
+{
+ glCopyPixels(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12),
+ *(GLenum *)(pc + 16)
+ );
+}
+
+void __glXDisp_DepthRange(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ glDepthRange(
+ *(GLclampd *)(pc + 0),
+ *(GLclampd *)(pc + 8)
+ );
+}
+
+void __glXDisp_Frustum(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 48);
+ pc -= 4;
+ }
+#endif
+ glFrustum(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24),
+ *(GLdouble *)(pc + 32),
+ *(GLdouble *)(pc + 40)
+ );
+}
+
+void __glXDisp_LoadIdentity(GLbyte *pc)
+{
+ glLoadIdentity(
+ );
+}
+
+void __glXDisp_LoadMatrixf(GLbyte *pc)
+{
+ glLoadMatrixf(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_LoadMatrixd(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 128);
+ pc -= 4;
+ }
+#endif
+ glLoadMatrixd(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_MatrixMode(GLbyte *pc)
+{
+ glMatrixMode(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultMatrixf(GLbyte *pc)
+{
+ glMultMatrixf(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultMatrixd(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 128);
+ pc -= 4;
+ }
+#endif
+ glMultMatrixd(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_Ortho(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 48);
+ pc -= 4;
+ }
+#endif
+ glOrtho(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24),
+ *(GLdouble *)(pc + 32),
+ *(GLdouble *)(pc + 40)
+ );
+}
+
+void __glXDisp_PopMatrix(GLbyte *pc)
+{
+ glPopMatrix(
+ );
+}
+
+void __glXDisp_PushMatrix(GLbyte *pc)
+{
+ glPushMatrix(
+ );
+}
+
+void __glXDisp_Rotated(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ glRotated(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24)
+ );
+}
+
+void __glXDisp_Rotatef(GLbyte *pc)
+{
+ glRotatef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLfloat *)(pc + 12)
+ );
+}
+
+void __glXDisp_Scaled(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glScaled(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDisp_Scalef(GLbyte *pc)
+{
+ glScalef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Translated(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ glTranslated(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDisp_Translatef(GLbyte *pc)
+{
+ glTranslatef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_Viewport(GLbyte *pc)
+{
+ glViewport(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12)
+ );
+}
+
+void __glXDisp_PolygonOffset(GLbyte *pc)
+{
+ glPolygonOffset(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_CopyTexImage1D(GLbyte *pc)
+{
+ glCopyTexImage1D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20),
+ *(GLint *)(pc + 24)
+ );
+}
+
+void __glXDisp_CopyTexImage2D(GLbyte *pc)
+{
+ glCopyTexImage2D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20),
+ *(GLsizei *)(pc + 24),
+ *(GLint *)(pc + 28)
+ );
+}
+
+void __glXDisp_CopyTexSubImage1D(GLbyte *pc)
+{
+ glCopyTexSubImage1D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20)
+ );
+}
+
+void __glXDisp_CopyTexSubImage2D(GLbyte *pc)
+{
+ glCopyTexSubImage2D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLint *)(pc + 20),
+ *(GLsizei *)(pc + 24),
+ *(GLsizei *)(pc + 28)
+ );
+}
+
+void __glXDisp_BindTexture(GLbyte *pc)
+{
+ glBindTexture(
+ *(GLenum *)(pc + 0),
+ *(GLuint *)(pc + 4)
+ );
+}
+
+void __glXDisp_PrioritizeTextures(GLbyte *pc)
+{
+ GLsizei n;
+
+ n = *(GLsizei *)(pc + 0);
+
+ glPrioritizeTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLclampf *)(pc + 4+n*4)
+ );
+}
+
+void __glXDisp_Indexubv(GLbyte *pc)
+{
+ glIndexubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDisp_BlendColor(GLbyte *pc)
+{
+ glBlendColor(
+ *(GLclampf *)(pc + 0),
+ *(GLclampf *)(pc + 4),
+ *(GLclampf *)(pc + 8),
+ *(GLclampf *)(pc + 12)
+ );
+}
+
+void __glXDisp_BlendEquation(GLbyte *pc)
+{
+ glBlendEquation(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_ColorTableParameterfv(GLbyte *pc)
+{
+ glColorTableParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_ColorTableParameteriv(GLbyte *pc)
+{
+ glColorTableParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_CopyColorTable(GLbyte *pc)
+{
+ glCopyColorTable(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDisp_CopyColorSubTable(GLbyte *pc)
+{
+ glCopyColorSubTable(
+ *(GLenum *)(pc + 0),
+ *(GLsizei *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDisp_ConvolutionParameterf(GLbyte *pc)
+{
+ glConvolutionParameterf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_ConvolutionParameterfv(GLbyte *pc)
+{
+ glConvolutionParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDisp_ConvolutionParameteri(GLbyte *pc)
+{
+ glConvolutionParameteri(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_ConvolutionParameteriv(GLbyte *pc)
+{
+ glConvolutionParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDisp_CopyConvolutionFilter1D(GLbyte *pc)
+{
+ glCopyConvolutionFilter1D(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDisp_CopyConvolutionFilter2D(GLbyte *pc)
+{
+ glCopyConvolutionFilter2D(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16),
+ *(GLsizei *)(pc + 20)
+ );
+}
+
+void __glXDisp_Histogram(GLbyte *pc)
+{
+ glHistogram(
+ *(GLenum *)(pc + 0),
+ *(GLsizei *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLboolean *)(pc + 12)
+ );
+}
+
+void __glXDisp_Minmax(GLbyte *pc)
+{
+ glMinmax(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLboolean *)(pc + 8)
+ );
+}
+
+void __glXDisp_ResetHistogram(GLbyte *pc)
+{
+ glResetHistogram(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_ResetMinmax(GLbyte *pc)
+{
+ glResetMinmax(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_CopyTexSubImage3D(GLbyte *pc)
+{
+ glCopyTexSubImage3D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLint *)(pc + 20),
+ *(GLint *)(pc + 24),
+ *(GLsizei *)(pc + 28),
+ *(GLsizei *)(pc + 32)
+ );
+}
+
+void __glXDisp_ActiveTextureARB(GLbyte *pc)
+{
+ glActiveTextureARB(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultiTexCoord1dvARB(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 12);
+ pc -= 4;
+ }
+#endif
+ glMultiTexCoord1dvARB(
+ *(GLenum *)(pc + 8),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultiTexCoord1fvARB(GLbyte *pc)
+{
+ glMultiTexCoord1fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord1ivARB(GLbyte *pc)
+{
+ glMultiTexCoord1ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord1svARB(GLbyte *pc)
+{
+ glMultiTexCoord1svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord2dvARB(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 20);
+ pc -= 4;
+ }
+#endif
+ glMultiTexCoord2dvARB(
+ *(GLenum *)(pc + 16),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultiTexCoord2fvARB(GLbyte *pc)
+{
+ glMultiTexCoord2fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord2ivARB(GLbyte *pc)
+{
+ glMultiTexCoord2ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord2svARB(GLbyte *pc)
+{
+ glMultiTexCoord2svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord3dvARB(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 28);
+ pc -= 4;
+ }
+#endif
+ glMultiTexCoord3dvARB(
+ *(GLenum *)(pc + 24),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultiTexCoord3fvARB(GLbyte *pc)
+{
+ glMultiTexCoord3fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord3ivARB(GLbyte *pc)
+{
+ glMultiTexCoord3ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord3svARB(GLbyte *pc)
+{
+ glMultiTexCoord3svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord4dvARB(GLbyte *pc)
+{
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 36);
+ pc -= 4;
+ }
+#endif
+ glMultiTexCoord4dvARB(
+ *(GLenum *)(pc + 32),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDisp_MultiTexCoord4fvARB(GLbyte *pc)
+{
+ glMultiTexCoord4fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord4ivARB(GLbyte *pc)
+{
+ glMultiTexCoord4ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDisp_MultiTexCoord4svARB(GLbyte *pc)
+{
+ glMultiTexCoord4svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+
+/*
+ * Extensions
+ */
+
+#ifndef MISSING_GL_EXTS
+
+void __glXDisp_PointParameterfARB(GLbyte *pc)
+{
+ glPointParameterfARB(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+
+void __glXDisp_PointParameterfvARB(GLbyte *pc)
+{
+ glPointParameterfvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+dispatch_template_enum1_1s(PointParameteriNV, GLint)
+dispatch_template_enum1_Vv(PointParameterivNV, GLint)
+
+void __glXDisp_ActiveStencilFaceEXT(GLbyte *pc)
+{
+ glActiveStencilFaceEXT(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDisp_WindowPos3fARB(GLbyte *pc)
+{
+ glWindowPos3fARB(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+#endif /* !MISSING_GL_EXTS */
+
+void __glXDisp_SampleCoverageARB(GLbyte *pc)
+{
+ glSampleCoverageARB(
+ *(GLfloat *)(pc + 0),
+ *(GLboolean *)(pc + 4)
+ );
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/g_renderswap.c b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c
new file mode 100644
index 000000000..f485a2690
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c
@@ -0,0 +1,3387 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_renderswap.c,v 1.8 2004/01/28 18:11:50 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "unpack.h"
+#include "impsize.h"
+#include "singlesize.h"
+
+void __glXDispSwap_CallList(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glCallList(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ListBase(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glListBase(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Begin(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glBegin(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3bv(GLbyte *pc)
+{
+ glColor3bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glColor3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+
+ glColor3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glColor3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glColor3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3ubv(GLbyte *pc)
+{
+ glColor3ubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3uiv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glColor3uiv(
+ (GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color3usv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glColor3usv(
+ (GLushort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4bv(GLbyte *pc)
+{
+ glColor4bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glColor4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+
+ glColor4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+
+ glColor4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+
+ glColor4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4ubv(GLbyte *pc)
+{
+ glColor4ubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4uiv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+
+ glColor4uiv(
+ (GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Color4usv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+
+ glColor4usv(
+ (GLushort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EdgeFlagv(GLbyte *pc)
+{
+ glEdgeFlagv(
+ (GLboolean *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_End(GLbyte *pc)
+{
+ glEnd(
+ );
+}
+
+void __glXDispSwap_Indexdv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+
+ glIndexdv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Indexfv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+
+ glIndexfv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Indexiv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 1);
+
+ glIndexiv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Indexsv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
+
+ glIndexsv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Normal3bv(GLbyte *pc)
+{
+ glNormal3bv(
+ (GLbyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Normal3dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glNormal3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Normal3fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+
+ glNormal3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Normal3iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glNormal3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Normal3sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glNormal3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos2dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+
+ glRasterPos2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos2fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+
+ glRasterPos2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos2iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+
+ glRasterPos2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos2sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+
+ glRasterPos2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos3dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glRasterPos3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos3fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+
+ glRasterPos3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos3iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glRasterPos3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos3sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glRasterPos3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos4dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glRasterPos4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos4fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+
+ glRasterPos4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos4iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+
+ glRasterPos4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_RasterPos4sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+
+ glRasterPos4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Rectdv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 16, 2);
+
+ glRectdv(
+ (GLdouble *)(pc + 0),
+ (GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_Rectfv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, 2);
+
+ glRectfv(
+ (GLfloat *)(pc + 0),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Rectiv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 8, 2);
+
+ glRectiv(
+ (GLint *)(pc + 0),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Rectsv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
+
+ glRectsv(
+ (GLshort *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_TexCoord1dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+
+ glTexCoord1dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord1fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+
+ glTexCoord1fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord1iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 1);
+
+ glTexCoord1iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord1sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
+
+ glTexCoord1sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord2dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+
+ glTexCoord2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord2fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+
+ glTexCoord2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord2iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+
+ glTexCoord2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord2sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+
+ glTexCoord2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord3dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glTexCoord3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord3fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+
+ glTexCoord3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord3iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glTexCoord3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord3sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glTexCoord3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord4dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glTexCoord4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord4fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+
+ glTexCoord4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord4iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+
+ glTexCoord4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexCoord4sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+
+ glTexCoord4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex2dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+
+ glVertex2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex2fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+
+ glVertex2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex2iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+
+ glVertex2iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex2sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+
+ glVertex2sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex3dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glVertex3dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex3fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+
+ glVertex3fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex3iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+
+ glVertex3iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex3sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+
+ glVertex3sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex4dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glVertex4dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex4fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+
+ glVertex4fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex4iv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+
+ glVertex4iv(
+ (GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Vertex4sv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+
+ glVertex4sv(
+ (GLshort *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ClipPlane(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 36);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glClipPlane(
+ *(GLenum *)(pc + 32),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ColorMaterial(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glColorMaterial(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_CullFace(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glCullFace(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Fogf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glFogf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Fogfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glFogfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+
+ glFogfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Fogi(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glFogi(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Fogiv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glFogiv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
+
+ glFogiv(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_FrontFace(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glFrontFace(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Hint(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glHint(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Lightf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glLightf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Lightfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glLightfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glLightfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Lighti(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glLighti(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Lightiv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glLightiv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glLightiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_LightModelf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glLightModelf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LightModelfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glLightModelfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+
+ glLightModelfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LightModeli(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glLightModeli(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LightModeliv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glLightModeliv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
+
+ glLightModeliv(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LineStipple(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT(pc + 4);
+
+ glLineStipple(
+ *(GLint *)(pc + 0),
+ *(GLushort *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LineWidth(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+
+ glLineWidth(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Materialf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glMaterialf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Materialfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glMaterialfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glMaterialfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Materiali(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glMateriali(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Materialiv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glMaterialiv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glMaterialiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_PointSize(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+
+ glPointSize(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_PolygonMode(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glPolygonMode(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Scissor(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+
+ glScissor(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_ShadeModel(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glShadeModel(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexParameterf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glTexParameterf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexParameterfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glTexParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexParameteri(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glTexParameteri(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexParameteriv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glTexParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexEnvf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glTexEnvf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexEnvfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexEnvfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glTexEnvfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexEnvi(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glTexEnvi(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexEnviv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexEnviv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glTexEnviv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexGend(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_DOUBLE(pc + 0);
+
+ glTexGend(
+ *(GLenum *)(pc + 8),
+ *(GLenum *)(pc + 12),
+ *(GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_TexGendv(GLbyte *pc)
+{
+ GLenum pname;
+#ifdef __GLX_ALIGN64
+ GLint cmdlen;
+#endif
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexGendv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+#ifdef __GLX_ALIGN64
+ cmdlen = __GLX_PAD(8+compsize*8);
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, cmdlen);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 8, compsize);
+
+ glTexGendv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexGenf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glTexGenf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexGenfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexGenfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glTexGenfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexGeni(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glTexGeni(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_TexGeniv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glTexGeniv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glTexGeniv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_InitNames(GLbyte *pc)
+{
+ glInitNames(
+ );
+}
+
+void __glXDispSwap_LoadName(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glLoadName(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_PassThrough(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+
+ glPassThrough(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_PopName(GLbyte *pc)
+{
+ glPopName(
+ );
+}
+
+void __glXDispSwap_PushName(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glPushName(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_DrawBuffer(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glDrawBuffer(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Clear(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glClear(
+ *(GLbitfield *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ClearAccum(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
+
+ glClearAccum(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLfloat *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_ClearIndex(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+
+ glClearIndex(
+ *(GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ClearColor(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
+
+ glClearColor(
+ *(GLclampf *)(pc + 0),
+ *(GLclampf *)(pc + 4),
+ *(GLclampf *)(pc + 8),
+ *(GLclampf *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_ClearStencil(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glClearStencil(
+ *(GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ClearDepth(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+
+ glClearDepth(
+ *(GLclampd *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_StencilMask(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glStencilMask(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ColorMask(GLbyte *pc)
+{
+ glColorMask(
+ *(GLboolean *)(pc + 0),
+ *(GLboolean *)(pc + 1),
+ *(GLboolean *)(pc + 2),
+ *(GLboolean *)(pc + 3)
+ );
+}
+
+void __glXDispSwap_DepthMask(GLbyte *pc)
+{
+ glDepthMask(
+ *(GLboolean *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_IndexMask(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glIndexMask(
+ *(GLuint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Accum(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glAccum(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_Disable(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glDisable(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Enable(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glEnable(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_PopAttrib(GLbyte *pc)
+{
+ glPopAttrib(
+ );
+}
+
+void __glXDispSwap_PushAttrib(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glPushAttrib(
+ *(GLbitfield *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MapGrid1d(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 20);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+
+ glMapGrid1d(
+ *(GLint *)(pc + 16),
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_MapGrid1f(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glMapGrid1f(
+ *(GLint *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_MapGrid2d(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 40);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 36);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+
+ glMapGrid2d(
+ *(GLint *)(pc + 32),
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLint *)(pc + 36),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24)
+ );
+}
+
+void __glXDispSwap_MapGrid2f(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 16);
+ __GLX_SWAP_FLOAT(pc + 20);
+
+ glMapGrid2f(
+ *(GLint *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLfloat *)(pc + 16),
+ *(GLfloat *)(pc + 20)
+ );
+}
+
+void __glXDispSwap_EvalCoord1dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 8);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+
+ glEvalCoord1dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EvalCoord1fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+
+ glEvalCoord1fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EvalCoord2dv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+
+ glEvalCoord2dv(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EvalCoord2fv(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+
+ glEvalCoord2fv(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EvalMesh1(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glEvalMesh1(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_EvalPoint1(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glEvalPoint1(
+ *(GLint *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_EvalMesh2(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ glEvalMesh2(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_EvalPoint2(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glEvalPoint2(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_AlphaFunc(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glAlphaFunc(
+ *(GLenum *)(pc + 0),
+ *(GLclampf *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_BlendFunc(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glBlendFunc(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_LogicOp(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glLogicOp(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_StencilFunc(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glStencilFunc(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLuint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_StencilOp(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glStencilOp(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_DepthFunc(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glDepthFunc(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_PixelZoom(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glPixelZoom(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PixelTransferf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glPixelTransferf(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PixelTransferi(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glPixelTransferi(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PixelMapfv(GLbyte *pc)
+{
+ GLint mapsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *)(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, mapsize);
+
+ glPixelMapfv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_PixelMapuiv(GLbyte *pc)
+{
+ GLint mapsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *)(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, mapsize);
+
+ glPixelMapuiv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLuint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_PixelMapusv(GLbyte *pc)
+{
+ GLint mapsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *)(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 8, mapsize);
+
+ glPixelMapusv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ (GLushort *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ReadBuffer(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glReadBuffer(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_CopyPixels(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ glCopyPixels(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12),
+ *(GLenum *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_DepthRange(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 16);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+
+ glDepthRange(
+ *(GLclampd *)(pc + 0),
+ *(GLclampd *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Frustum(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 48);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_DOUBLE(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 40);
+
+ glFrustum(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24),
+ *(GLdouble *)(pc + 32),
+ *(GLdouble *)(pc + 40)
+ );
+}
+
+void __glXDispSwap_LoadIdentity(GLbyte *pc)
+{
+ glLoadIdentity(
+ );
+}
+
+void __glXDispSwap_LoadMatrixf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
+
+ glLoadMatrixf(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_LoadMatrixd(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 128);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
+
+ glLoadMatrixd(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MatrixMode(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glMatrixMode(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultMatrixf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
+
+ glMultMatrixf(
+ (GLfloat *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultMatrixd(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 128);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
+
+ glMultMatrixd(
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_Ortho(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 48);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_DOUBLE(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 40);
+
+ glOrtho(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24),
+ *(GLdouble *)(pc + 32),
+ *(GLdouble *)(pc + 40)
+ );
+}
+
+void __glXDispSwap_PopMatrix(GLbyte *pc)
+{
+ glPopMatrix(
+ );
+}
+
+void __glXDispSwap_PushMatrix(GLbyte *pc)
+{
+ glPushMatrix(
+ );
+}
+
+void __glXDispSwap_Rotated(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 32);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+
+ glRotated(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16),
+ *(GLdouble *)(pc + 24)
+ );
+}
+
+void __glXDispSwap_Rotatef(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
+
+ glRotatef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8),
+ *(GLfloat *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_Scaled(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+
+ glScaled(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_Scalef(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glScalef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Translated(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 24);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+
+ glTranslated(
+ *(GLdouble *)(pc + 0),
+ *(GLdouble *)(pc + 8),
+ *(GLdouble *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_Translatef(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glTranslatef(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_Viewport(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+
+ glViewport(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_PolygonOffset(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glPolygonOffset(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_CopyTexImage1D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+
+ glCopyTexImage1D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20),
+ *(GLint *)(pc + 24)
+ );
+}
+
+void __glXDispSwap_CopyTexImage2D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
+
+ glCopyTexImage2D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20),
+ *(GLsizei *)(pc + 24),
+ *(GLint *)(pc + 28)
+ );
+}
+
+void __glXDispSwap_CopyTexSubImage1D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+
+ glCopyTexSubImage1D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLsizei *)(pc + 20)
+ );
+}
+
+void __glXDispSwap_CopyTexSubImage2D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
+
+ glCopyTexSubImage2D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLint *)(pc + 20),
+ *(GLsizei *)(pc + 24),
+ *(GLsizei *)(pc + 28)
+ );
+}
+
+void __glXDispSwap_BindTexture(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glBindTexture(
+ *(GLenum *)(pc + 0),
+ *(GLuint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PrioritizeTextures(GLbyte *pc)
+{
+ GLsizei n;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4+n*4, n);
+
+ glPrioritizeTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLclampf *)(pc + 4+n*4)
+ );
+}
+
+void __glXDispSwap_Indexubv(GLbyte *pc)
+{
+ glIndexubv(
+ (GLubyte *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_BlendColor(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
+
+ glBlendColor(
+ *(GLclampf *)(pc + 0),
+ *(GLclampf *)(pc + 4),
+ *(GLclampf *)(pc + 8),
+ *(GLclampf *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_BlendEquation(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glBlendEquation(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ColorTableParameterfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glColorTableParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glColorTableParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ColorTableParameteriv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glColorTableParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glColorTableParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_CopyColorTable(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ glCopyColorTable(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_CopyColorSubTable(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ glCopyColorSubTable(
+ *(GLenum *)(pc + 0),
+ *(GLsizei *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_ConvolutionParameterf(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ glConvolutionParameterf(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ConvolutionParameterfv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glConvolutionParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+
+ glConvolutionParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ConvolutionParameteri(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glConvolutionParameteri(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ConvolutionParameteriv(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glConvolutionParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+
+ glConvolutionParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_CopyConvolutionFilter1D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ glCopyConvolutionFilter1D(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16)
+ );
+}
+
+void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+
+ glCopyConvolutionFilter2D(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLsizei *)(pc + 16),
+ *(GLsizei *)(pc + 20)
+ );
+}
+
+void __glXDispSwap_Histogram(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+
+ glHistogram(
+ *(GLenum *)(pc + 0),
+ *(GLsizei *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLboolean *)(pc + 12)
+ );
+}
+
+void __glXDispSwap_Minmax(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glMinmax(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLboolean *)(pc + 8)
+ );
+}
+
+void __glXDispSwap_ResetHistogram(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glResetHistogram(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_ResetMinmax(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glResetMinmax(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_CopyTexSubImage3D(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
+ __GLX_SWAP_INT(pc + 32);
+
+ glCopyTexSubImage3D(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLint *)(pc + 8),
+ *(GLint *)(pc + 12),
+ *(GLint *)(pc + 16),
+ *(GLint *)(pc + 20),
+ *(GLint *)(pc + 24),
+ *(GLsizei *)(pc + 28),
+ *(GLsizei *)(pc + 32)
+ );
+}
+
+void __glXDispSwap_ActiveTextureARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glActiveTextureARB(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord1dvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 12);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+
+ glMultiTexCoord1dvARB(
+ *(GLenum *)(pc + 8),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord1fvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 1);
+
+ glMultiTexCoord1fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord1ivARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 1);
+
+ glMultiTexCoord1ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord1svARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 1);
+
+ glMultiTexCoord1svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord2dvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 20);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+
+ glMultiTexCoord2dvARB(
+ *(GLenum *)(pc + 16),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord2fvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 2);
+
+ glMultiTexCoord2fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord2ivARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 2);
+
+ glMultiTexCoord2ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord2svARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
+
+ glMultiTexCoord2svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord3dvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 28);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+
+ glMultiTexCoord3dvARB(
+ *(GLenum *)(pc + 24),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord3fvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 3);
+
+ glMultiTexCoord3fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord3ivARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 3);
+
+ glMultiTexCoord3ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord3svARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 3);
+
+ glMultiTexCoord3svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord4dvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+#ifdef __GLX_ALIGN64
+ if ((unsigned long)(pc) & 7) {
+ __GLX_MEM_COPY(pc-4, pc, 36);
+ pc -= 4;
+ }
+#endif
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+
+ glMultiTexCoord4dvARB(
+ *(GLenum *)(pc + 32),
+ (GLdouble *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord4fvARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 4);
+
+ glMultiTexCoord4fvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord4ivARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 4);
+
+ glMultiTexCoord4ivARB(
+ *(GLenum *)(pc + 0),
+ (GLint *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_MultiTexCoord4svARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 4);
+
+ glMultiTexCoord4svARB(
+ *(GLenum *)(pc + 0),
+ (GLshort *)(pc + 4)
+ );
+}
+
+
+/*
+ * Extensions
+ */
+
+#ifndef MISSING_GL_EXTS
+
+void __glXDispSwap_PointParameterfARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ glPointParameterfARB(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_PointParameterfvARB(GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glPointParameterfvEXT_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+
+ glPointParameterfvARB(
+ *(GLenum *)(pc + 0),
+ (GLfloat *)(pc + 4)
+ );
+}
+
+void __glXDispSwap_ActiveStencilFaceEXT(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+
+ glActiveStencilFaceEXT(
+ *(GLenum *)(pc + 0)
+ );
+}
+
+void __glXDispSwap_WindowPos3fARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ glWindowPos3fARB(
+ *(GLfloat *)(pc + 0),
+ *(GLfloat *)(pc + 4),
+ *(GLfloat *)(pc + 8)
+ );
+}
+#endif /* !MISSING_GL_EXTS */
+
+void __glXDispSwap_SampleCoverageARB(GLbyte *pc)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glSampleCoverageARB(
+ *(GLfloat *)(pc + 0),
+ *(GLboolean *)(pc + 4)
+ );
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/g_single.c b/nx-X11/programs/Xserver/GL/glx/g_single.c
new file mode 100644
index 000000000..a60bf44c1
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_single.c
@@ -0,0 +1,1787 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_single.c,v 1.5tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "unpack.h"
+#include "impsize.h"
+#include "singlesize.h"
+
+int __glXDisp_NewList(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ glNewList(
+ *(GLuint *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_EndList(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ glEndList(
+ );
+ return Success;
+}
+
+int __glXDisp_DeleteLists(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ glDeleteLists(
+ *(GLuint *)(pc + 0),
+ *(GLsizei *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_GenLists(__GLXclientState *cl, GLbyte *pc)
+{
+ GLuint retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ retval =
+ glGenLists(
+ *(GLsizei *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDisp_PixelStoref(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ glPixelStoref(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_PixelStorei(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ glPixelStorei(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_GetBooleanv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetBooleanv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetBooleanv(
+ *(GLenum *)(pc + 0),
+ (GLboolean *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_BYTE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetDoublev(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetDoublev_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetDoublev(
+ *(GLenum *)(pc + 0),
+ (GLdouble *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetError(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ retval =
+ glGetError(
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDisp_GetFloatv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetFloatv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetFloatv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetIntegerv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetIntegerv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetIntegerv(
+ *(GLenum *)(pc + 0),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetLightfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetLightfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetLightfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetLightiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetLightiv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetLightiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMapdv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapdv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetMapdv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMapfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapfv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMapfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMapiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapiv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMapiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMaterialfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMaterialfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMaterialfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMaterialiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMaterialiv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMaterialiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetPixelMapfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapfv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetPixelMapfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetPixelMapuiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapuiv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetPixelMapuiv(
+ *(GLenum *)(pc + 0),
+ (GLuint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetPixelMapusv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLushort answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapusv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
+ __glXClearErrorOccured();
+ glGetPixelMapusv(
+ *(GLenum *)(pc + 0),
+ (GLushort *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_SHORT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*2);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_SHORT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexEnvfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexEnvfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexEnvfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexEnviv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexEnviv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexEnviv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexGendv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGendv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetTexGendv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexGenfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGenfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexGenfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexGeniv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGeniv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexGeniv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexLevelParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 8);
+ compsize = __glGetTexLevelParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexLevelParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexLevelParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 8);
+ compsize = __glGetTexLevelParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexLevelParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_IsEnabled(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ retval =
+ glIsEnabled(
+ *(GLenum *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDisp_IsList(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ retval =
+ glIsList(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDisp_AreTexturesResident(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
+ retval =
+ glAreTexturesResident(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLboolean *) answer
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(n);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(n);
+ return Success;
+}
+
+int __glXDisp_DeleteTextures(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ glDeleteTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4)
+ );
+ return Success;
+}
+
+int __glXDisp_GenTextures(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
+ glGenTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *) answer
+ );
+ __GLX_BEGIN_REPLY(n*4);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(n);
+ return Success;
+}
+
+int __glXDisp_IsTexture(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ retval =
+ glIsTexture(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDisp_GetColorTableParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetColorTableParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetColorTableParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetColorTableParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetColorTableParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetColorTableParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetConvolutionParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetConvolutionParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetConvolutionParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetConvolutionParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetConvolutionParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetConvolutionParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetHistogramParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetHistogramParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetHistogramParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetHistogramParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetHistogramParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetHistogramParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMinmaxParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMinmaxParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMinmaxParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetMinmaxParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMinmaxParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMinmaxParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_SIZE(1);
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_AreTexturesResidentEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
+ retval =
+ glAreTexturesResidentEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLboolean *) answer
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(n);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(n);
+ return Success;
+}
+
+int __glXDisp_DeleteTexturesEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ glDeleteTexturesEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4)
+ );
+ return Success;
+}
+
+int __glXDisp_GenTexturesEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
+ glGenTexturesEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *) answer
+ );
+ __GLX_BEGIN_REPLY(n*4);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(n);
+ return Success;
+}
+
+int __glXDisp_IsTextureEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ retval =
+ glIsTextureEXT(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/g_singleswap.c b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c
new file mode 100644
index 000000000..026530374
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c
@@ -0,0 +1,2208 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/g_singleswap.c,v 1.4tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "unpack.h"
+#include "impsize.h"
+#include "singlesize.h"
+
+int __glXDispSwap_NewList(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glNewList(
+ *(GLuint *)(pc + 0),
+ *(GLenum *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_EndList(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ glEndList(
+ );
+ return Success;
+}
+
+int __glXDispSwap_DeleteLists(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glDeleteLists(
+ *(GLuint *)(pc + 0),
+ *(GLsizei *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_GenLists(__GLXclientState *cl, GLbyte *pc)
+{
+ GLuint retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ retval =
+ glGenLists(
+ *(GLsizei *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDispSwap_PixelStoref(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+
+ glPixelStoref(
+ *(GLenum *)(pc + 0),
+ *(GLfloat *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_PixelStorei(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ glPixelStorei(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4)
+ );
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_GetBooleanv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetBooleanv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetBooleanv(
+ *(GLenum *)(pc + 0),
+ (GLboolean *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_BYTE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetDoublev(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetDoublev_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetDoublev(
+ *(GLenum *)(pc + 0),
+ (GLdouble *) answer
+ );
+ __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetError(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ retval =
+ glGetError(
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDispSwap_GetFloatv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetFloatv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetFloatv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetIntegerv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *)(pc + 0);
+ compsize = __glGetIntegerv_size(pname);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetIntegerv(
+ *(GLenum *)(pc + 0),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetLightfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetLightfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetLightfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetLightiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetLightiv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetLightiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMapdv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapdv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetMapdv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *) answer
+ );
+ __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMapfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapfv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMapfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMapiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum target;
+ GLenum query;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ target = *(GLenum *)(pc + 0);
+ query = *(GLenum *)(pc + 4);
+ compsize = __glGetMapiv_size(target,query);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMapiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMaterialfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMaterialfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMaterialfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMaterialiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMaterialiv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMaterialiv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetPixelMapfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapfv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetPixelMapfv(
+ *(GLenum *)(pc + 0),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetPixelMapuiv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapuiv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetPixelMapuiv(
+ *(GLenum *)(pc + 0),
+ (GLuint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetPixelMapusv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum map;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLushort answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ map = *(GLenum *)(pc + 0);
+ compsize = __glGetPixelMapusv_size(map);
+ if (compsize < 0) compsize = 0;
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
+ __glXClearErrorOccured();
+ glGetPixelMapusv(
+ *(GLenum *)(pc + 0),
+ (GLushort *) answer
+ );
+ __GLX_SWAP_SHORT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_SHORT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*2);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_SHORT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexEnvfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexEnvfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexEnvfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexEnviv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexEnviv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexEnviv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexGendv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGendv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
+ __glXClearErrorOccured();
+ glGetTexGendv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLdouble *) answer
+ );
+ __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_DOUBLE();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*8);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexGenfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGenfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexGenfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexGeniv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexGeniv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexGeniv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetTexParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 8);
+ pname = *(GLenum *)(pc + 8);
+ compsize = __glGetTexLevelParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexLevelParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 8);
+ pname = *(GLenum *)(pc + 8);
+ compsize = __glGetTexLevelParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetTexLevelParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_IsEnabled(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ retval =
+ glIsEnabled(
+ *(GLenum *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDispSwap_IsList(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ retval =
+ glIsList(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDispSwap_AreTexturesResident(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
+ retval =
+ glAreTexturesResident(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLboolean *) answer
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(n);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(n);
+ return Success;
+}
+
+int __glXDispSwap_DeleteTextures(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+
+ glDeleteTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4)
+ );
+ return Success;
+}
+
+int __glXDispSwap_GenTextures(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
+ glGenTextures(
+ *(GLsizei *)(pc + 0),
+ (GLuint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, n);
+ __GLX_BEGIN_REPLY(n*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(n);
+ return Success;
+}
+
+int __glXDispSwap_IsTexture(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ retval =
+ glIsTexture(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+int __glXDispSwap_GetColorTableParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetColorTableParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetColorTableParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetColorTableParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetColorTableParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetColorTableParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetConvolutionParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetConvolutionParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetConvolutionParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetConvolutionParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetHistogramParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetHistogramParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetHistogramParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetHistogramParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetHistogramParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetHistogramParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLfloat answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMinmaxParameterfv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMinmaxParameterfv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLfloat *) answer
+ );
+ __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_FLOAT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_FLOAT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState *cl, GLbyte *pc)
+{
+ GLenum pname;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *)(pc + 4);
+ compsize = __glGetMinmaxParameteriv_size(pname);
+ if (compsize < 0) compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
+ __glXClearErrorOccured();
+ glGetMinmaxParameteriv(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ (GLint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, compsize);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(0);
+ __GLX_SEND_HEADER();
+ } else if (compsize == 1) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(1);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_PUT_INT();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_PUT_SIZE(compsize);
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLboolean answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
+ retval =
+ glAreTexturesResidentEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4),
+ (GLboolean *) answer
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(n);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(n);
+ return Success;
+}
+
+int __glXDispSwap_DeleteTexturesEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+
+ glDeleteTexturesEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *)(pc + 4)
+ );
+ return Success;
+}
+
+int __glXDispSwap_GenTexturesEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei n;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLuint answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *)(pc + 0);
+
+ __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
+ glGenTexturesEXT(
+ *(GLsizei *)(pc + 0),
+ (GLuint *) answer
+ );
+ __GLX_SWAP_INT_ARRAY(answer, n);
+ __GLX_BEGIN_REPLY(n*4);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_INT_ARRAY(n);
+ return Success;
+}
+
+int __glXDispSwap_IsTextureEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean retval;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ retval =
+ glIsTextureEXT(
+ *(GLuint *)(pc + 0)
+ );
+ __GLX_PUT_RETVAL(retval);
+ __GLX_SWAP_REPLY_RETVAL();
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/global.c b/nx-X11/programs/Xserver/GL/glx/global.c
new file mode 100644
index 000000000..18cd5edc2
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/global.c
@@ -0,0 +1,76 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+
+/*
+** The last context used by the server. It is the context that is current
+** from the server's perspective.
+*/
+__GLXcontext *__glXLastContext;
+
+/*
+** X resources.
+*/
+RESTYPE __glXContextRes;
+RESTYPE __glXClientRes;
+RESTYPE __glXPixmapRes;
+RESTYPE __glXSwapBarrierRes;
+
+/*
+** Error codes with the extension error base already added in.
+*/
+int __glXBadContext, __glXBadContextState, __glXBadDrawable, __glXBadPixmap;
+int __glXBadContextTag, __glXBadCurrentWindow;
+int __glXBadRenderRequest, __glXBadLargeRequest;
+int __glXUnsupportedPrivateRequest;
+
+/*
+** Reply for most singles.
+*/
+xGLXSingleReply __glXReply;
+
+/*
+** A set of state for each client. The 0th one is unused because client
+** indices start at 1, not 0.
+*/
+__GLXclientState *__glXClients[MAXCLIENTS+1];
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glx-def.cpp b/nx-X11/programs/Xserver/GL/glx/glx-def.cpp
new file mode 100644
index 000000000..a653f4cb7
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glx-def.cpp
@@ -0,0 +1,662 @@
+LIBRARY GLX
+VERSION LIBRARY_VERSION
+EXPORTS
+__glXFBInitDrawable
+__glXFreeBuffers
+__glXPixInitDrawable
+__glXResizeBuffers
+__glXClientInfo
+__glXCopyContext
+__glXCreateContext
+__glXCreateGLXPixmap
+__glXDestroyContext
+__glXDestroyGLXPixmap
+__glXGetVisualConfigs
+__glXIsDirect
+__glXLookupContextByTag
+__glXMakeCurrent
+__glXQueryContextInfoEXT
+__glXQueryExtensionsString
+__glXQueryServerString
+__glXQueryVersion
+__glXRender
+__glXRenderLarge
+__glXSwapBuffers
+__glXVendorPrivate
+__glXVendorPrivateWithReply
+__glXWaitGL
+__glXWaitX
+__glXSwapClientInfo
+__glXSwapCopyContext
+__glXSwapCreateContext
+__glXSwapCreateGLXPixmap
+__glXSwapDestroyContext
+__glXSwapDestroyGLXPixmap
+__glXSwapGetVisualConfigs
+__glXSwapIsDirect
+__glXSwapIsDirectReply
+__glXSwapMakeCurrent
+__glXSwapMakeCurrentReply
+__glXSwapQueryContextInfoEXT
+__glXSwapQueryContextInfoEXTReply
+__glXSwapQueryExtensionsString
+__glXSwapQueryServerString
+__glXSwapQueryVersion
+__glXSwapQueryVersionReply
+__glXSwapRender
+__glXSwapRenderLarge
+__glXSwapSwapBuffers
+__glXSwapUseXFont
+__glXSwapVendorPrivate
+__glXSwapVendorPrivateWithReply
+__glXSwapWaitGL
+__glXSwapWaitX
+glxSwapQueryExtensionsStringReply
+glxSwapQueryServerStringReply
+GlxExtensionInit
+GlxInitVisuals
+GlxSetVisualConfigs
+GlxWrapInitVisuals
+__glXClearErrorOccured
+__glXCoreType
+__glXErrorCallBack
+__glXErrorOccured
+__glXFlushContextCache
+__glXForceCurrent
+__glXFreeContext
+__glXNoSuchRenderOpcode
+__glXNoSuchSingleOpcode
+__glXResetLargeCommandStatus
+__glXFBGetGC
+__glXFBMemSwapBuffers
+__glXInitFB
+__glXImpCalloc
+__glXImpFatal
+__glXImpFclose
+__glXImpFopen
+__glXImpFprintf
+__glXImpFree
+__glXImpGetDrawablePrivate
+__glXImpGetenv
+__glXImpMalloc
+__glXImpRealloc
+__glXImpSprintf
+__glXImpWarning
+__glXInitMem
+__glXInitPix
+__glXScreenInit
+__glXAssociateContext
+__glXCacheDrawableSize
+__glXCalloc
+__glXCreateDrawablePrivate
+__glXDeassociateContext
+__glXDestroyDrawablePrivate
+__glXFindDrawablePrivate
+__glXFree
+__glXGetDrawablePrivate
+__glXGetDrawableSize
+__glXMalloc
+__glXNop
+__glXRealloc
+__glXRefDrawablePrivate
+__glXResizeDrawable
+__glXResizeDrawableBuffers
+__glXUnrefDrawablePrivate
+__glXDisp_CallLists
+__glXDisp_DrawArrays
+__glXDisp_Map1d
+__glXDisp_Map1f
+__glXDisp_Map2d
+__glXDisp_Map2f
+__glXDispSwap_CallLists
+__glXDispSwap_DrawArrays
+__glXDispSwap_Map1d
+__glXDispSwap_Map1f
+__glXDispSwap_Map2d
+__glXDispSwap_Map2f
+__glXDisp_Bitmap
+__glXDisp_DrawPixels
+__glXDisp_PolygonStipple
+__glXDisp_TexImage1D
+__glXDisp_TexImage2D
+__glXDisp_TexSubImage1D
+__glXDisp_TexSubImage2D
+__glXDispSwap_Bitmap
+__glXDispSwap_DrawPixels
+__glXDispSwap_PolygonStipple
+__glXDispSwap_TexImage1D
+__glXDispSwap_TexImage2D
+__glXDispSwap_TexSubImage1D
+__glXDispSwap_TexSubImage2D
+__glXBitmapReqSize
+__glXCallListsReqSize
+__glXDrawArraysSize
+__glXDrawPixelsReqSize
+__glXFogfvReqSize
+__glXFogivReqSize
+__glXLightModelfvReqSize
+__glXLightModelivReqSize
+__glXLightfvReqSize
+__glXLightivReqSize
+__glXMap1dReqSize
+__glXMap1fReqSize
+__glXMap2dReqSize
+__glXMap2fReqSize
+__glXMaterialfvReqSize
+__glXMaterialivReqSize
+__glXPixelMapfvReqSize
+__glXPixelMapuivReqSize
+__glXPixelMapusvReqSize
+__glXPrioritizeTexturesReqSize
+__glXTexEnvfvReqSize
+__glXTexEnvivReqSize
+__glXTexGendvReqSize
+__glXTexGenfvReqSize
+__glXTexGenivReqSize
+__glXTexImage1DReqSize
+__glXTexImage2DReqSize
+__glXTexParameterfvReqSize
+__glXTexParameterivReqSize
+__glXTexSubImage1DReqSize
+__glXTexSubImage2DReqSize
+__glXTypeSize
+__glXDisp_FeedbackBuffer
+__glXDisp_Finish
+__glXDisp_Flush
+__glXDisp_GetClipPlane
+__glXDisp_GetString
+__glXDisp_RenderMode
+__glXDisp_SelectBuffer
+__glXcombine_strings
+__glXDispSwap_FeedbackBuffer
+__glXDispSwap_Finish
+__glXDispSwap_Flush
+__glXDispSwap_GetClipPlane
+__glXDispSwap_GetString
+__glXDispSwap_RenderMode
+__glXDispSwap_SelectBuffer
+__glXDisp_GetPolygonStipple
+__glXDisp_GetTexImage
+__glXDisp_ReadPixels
+__glXDispSwap_GetPolygonStipple
+__glXDispSwap_GetTexImage
+__glXDispSwap_ReadPixels
+__glGetBooleanv_size
+__glGetDoublev_size
+__glGetFloatv_size
+__glGetIntegerv_size
+__glGetLightfv_size
+__glGetLightiv_size
+__glGetMap_size
+__glGetMapdv_size
+__glGetMapfv_size
+__glGetMapiv_size
+__glGetMaterialfv_size
+__glGetMaterialiv_size
+__glGetPixelMap_size
+__glGetPixelMapfv_size
+__glGetPixelMapuiv_size
+__glGetPixelMapusv_size
+__glGetTexEnvfv_size
+__glGetTexEnviv_size
+__glGetTexGendv_size
+__glGetTexGenfv_size
+__glGetTexGeniv_size
+__glGetTexImage_size
+__glGetTexLevelParameterfv_size
+__glGetTexLevelParameteriv_size
+__glGetTexParameterfv_size
+__glGetTexParameteriv_size
+__glGet_size
+__glReadPixels_size
+__glXUseXFont
+__glXDisp_Accum
+__glXDisp_AlphaFunc
+__glXDisp_Begin
+__glXDisp_BindTexture
+__glXDisp_BlendFunc
+__glXDisp_CallList
+__glXDisp_Clear
+__glXDisp_ClearAccum
+__glXDisp_ClearColor
+__glXDisp_ClearDepth
+__glXDisp_ClearIndex
+__glXDisp_ClearStencil
+__glXDisp_ClipPlane
+__glXDisp_Color3bv
+__glXDisp_Color3dv
+__glXDisp_Color3fv
+__glXDisp_Color3iv
+__glXDisp_Color3sv
+__glXDisp_Color3ubv
+__glXDisp_Color3uiv
+__glXDisp_Color3usv
+__glXDisp_Color4bv
+__glXDisp_Color4dv
+__glXDisp_Color4fv
+__glXDisp_Color4iv
+__glXDisp_Color4sv
+__glXDisp_Color4ubv
+__glXDisp_Color4uiv
+__glXDisp_Color4usv
+__glXDisp_ColorMask
+__glXDisp_ColorMaterial
+__glXDisp_CopyPixels
+__glXDisp_CopyTexImage1D
+__glXDisp_CopyTexImage2D
+__glXDisp_CopyTexSubImage1D
+__glXDisp_CopyTexSubImage2D
+__glXDisp_CullFace
+__glXDisp_DepthFunc
+__glXDisp_DepthMask
+__glXDisp_DepthRange
+__glXDisp_Disable
+__glXDisp_DrawBuffer
+__glXDisp_EdgeFlagv
+__glXDisp_Enable
+__glXDisp_End
+__glXDisp_EvalCoord1dv
+__glXDisp_EvalCoord1fv
+__glXDisp_EvalCoord2dv
+__glXDisp_EvalCoord2fv
+__glXDisp_EvalMesh1
+__glXDisp_EvalMesh2
+__glXDisp_EvalPoint1
+__glXDisp_EvalPoint2
+__glXDisp_Fogf
+__glXDisp_Fogfv
+__glXDisp_Fogi
+__glXDisp_Fogiv
+__glXDisp_FrontFace
+__glXDisp_Frustum
+__glXDisp_Hint
+__glXDisp_IndexMask
+__glXDisp_Indexdv
+__glXDisp_Indexfv
+__glXDisp_Indexiv
+__glXDisp_Indexsv
+__glXDisp_Indexubv
+__glXDisp_InitNames
+__glXDisp_LightModelf
+__glXDisp_LightModelfv
+__glXDisp_LightModeli
+__glXDisp_LightModeliv
+__glXDisp_Lightf
+__glXDisp_Lightfv
+__glXDisp_Lighti
+__glXDisp_Lightiv
+__glXDisp_LineStipple
+__glXDisp_LineWidth
+__glXDisp_ListBase
+__glXDisp_LoadIdentity
+__glXDisp_LoadMatrixd
+__glXDisp_LoadMatrixf
+__glXDisp_LoadName
+__glXDisp_LogicOp
+__glXDisp_MapGrid1d
+__glXDisp_MapGrid1f
+__glXDisp_MapGrid2d
+__glXDisp_MapGrid2f
+__glXDisp_Materialf
+__glXDisp_Materialfv
+__glXDisp_Materiali
+__glXDisp_Materialiv
+__glXDisp_MatrixMode
+__glXDisp_MultMatrixd
+__glXDisp_MultMatrixf
+__glXDisp_Normal3bv
+__glXDisp_Normal3dv
+__glXDisp_Normal3fv
+__glXDisp_Normal3iv
+__glXDisp_Normal3sv
+__glXDisp_Ortho
+__glXDisp_PassThrough
+__glXDisp_PixelMapfv
+__glXDisp_PixelMapuiv
+__glXDisp_PixelMapusv
+__glXDisp_PixelTransferf
+__glXDisp_PixelTransferi
+__glXDisp_PixelZoom
+__glXDisp_PointSize
+__glXDisp_PolygonMode
+__glXDisp_PolygonOffset
+__glXDisp_PopAttrib
+__glXDisp_PopMatrix
+__glXDisp_PopName
+__glXDisp_PrioritizeTextures
+__glXDisp_PushAttrib
+__glXDisp_PushMatrix
+__glXDisp_PushName
+__glXDisp_RasterPos2dv
+__glXDisp_RasterPos2fv
+__glXDisp_RasterPos2iv
+__glXDisp_RasterPos2sv
+__glXDisp_RasterPos3dv
+__glXDisp_RasterPos3fv
+__glXDisp_RasterPos3iv
+__glXDisp_RasterPos3sv
+__glXDisp_RasterPos4dv
+__glXDisp_RasterPos4fv
+__glXDisp_RasterPos4iv
+__glXDisp_RasterPos4sv
+__glXDisp_ReadBuffer
+__glXDisp_Rectdv
+__glXDisp_Rectfv
+__glXDisp_Rectiv
+__glXDisp_Rectsv
+__glXDisp_Rotated
+__glXDisp_Rotatef
+__glXDisp_Scaled
+__glXDisp_Scalef
+__glXDisp_Scissor
+__glXDisp_ShadeModel
+__glXDisp_StencilFunc
+__glXDisp_StencilMask
+__glXDisp_StencilOp
+__glXDisp_TexCoord1dv
+__glXDisp_TexCoord1fv
+__glXDisp_TexCoord1iv
+__glXDisp_TexCoord1sv
+__glXDisp_TexCoord2dv
+__glXDisp_TexCoord2fv
+__glXDisp_TexCoord2iv
+__glXDisp_TexCoord2sv
+__glXDisp_TexCoord3dv
+__glXDisp_TexCoord3fv
+__glXDisp_TexCoord3iv
+__glXDisp_TexCoord3sv
+__glXDisp_TexCoord4dv
+__glXDisp_TexCoord4fv
+__glXDisp_TexCoord4iv
+__glXDisp_TexCoord4sv
+__glXDisp_TexEnvf
+__glXDisp_TexEnvfv
+__glXDisp_TexEnvi
+__glXDisp_TexEnviv
+__glXDisp_TexGend
+__glXDisp_TexGendv
+__glXDisp_TexGenf
+__glXDisp_TexGenfv
+__glXDisp_TexGeni
+__glXDisp_TexGeniv
+__glXDisp_TexParameterf
+__glXDisp_TexParameterfv
+__glXDisp_TexParameteri
+__glXDisp_TexParameteriv
+__glXDisp_Translated
+__glXDisp_Translatef
+__glXDisp_Vertex2dv
+__glXDisp_Vertex2fv
+__glXDisp_Vertex2iv
+__glXDisp_Vertex2sv
+__glXDisp_Vertex3dv
+__glXDisp_Vertex3fv
+__glXDisp_Vertex3iv
+__glXDisp_Vertex3sv
+__glXDisp_Vertex4dv
+__glXDisp_Vertex4fv
+__glXDisp_Vertex4iv
+__glXDisp_Vertex4sv
+__glXDisp_Viewport
+__glXDispSwap_Accum
+__glXDispSwap_AlphaFunc
+__glXDispSwap_Begin
+__glXDispSwap_BindTexture
+__glXDispSwap_BlendFunc
+__glXDispSwap_CallList
+__glXDispSwap_Clear
+__glXDispSwap_ClearAccum
+__glXDispSwap_ClearColor
+__glXDispSwap_ClearDepth
+__glXDispSwap_ClearIndex
+__glXDispSwap_ClearStencil
+__glXDispSwap_ClipPlane
+__glXDispSwap_Color3bv
+__glXDispSwap_Color3dv
+__glXDispSwap_Color3fv
+__glXDispSwap_Color3iv
+__glXDispSwap_Color3sv
+__glXDispSwap_Color3ubv
+__glXDispSwap_Color3uiv
+__glXDispSwap_Color3usv
+__glXDispSwap_Color4bv
+__glXDispSwap_Color4dv
+__glXDispSwap_Color4fv
+__glXDispSwap_Color4iv
+__glXDispSwap_Color4sv
+__glXDispSwap_Color4ubv
+__glXDispSwap_Color4uiv
+__glXDispSwap_Color4usv
+__glXDispSwap_ColorMask
+__glXDispSwap_ColorMaterial
+__glXDispSwap_CopyPixels
+__glXDispSwap_CopyTexImage1D
+__glXDispSwap_CopyTexImage2D
+__glXDispSwap_CopyTexSubImage1D
+__glXDispSwap_CopyTexSubImage2D
+__glXDispSwap_CullFace
+__glXDispSwap_DepthFunc
+__glXDispSwap_DepthMask
+__glXDispSwap_DepthRange
+__glXDispSwap_Disable
+__glXDispSwap_DrawBuffer
+__glXDispSwap_EdgeFlagv
+__glXDispSwap_Enable
+__glXDispSwap_End
+__glXDispSwap_EvalCoord1dv
+__glXDispSwap_EvalCoord1fv
+__glXDispSwap_EvalCoord2dv
+__glXDispSwap_EvalCoord2fv
+__glXDispSwap_EvalMesh1
+__glXDispSwap_EvalMesh2
+__glXDispSwap_EvalPoint1
+__glXDispSwap_EvalPoint2
+__glXDispSwap_Fogf
+__glXDispSwap_Fogfv
+__glXDispSwap_Fogi
+__glXDispSwap_Fogiv
+__glXDispSwap_FrontFace
+__glXDispSwap_Frustum
+__glXDispSwap_Hint
+__glXDispSwap_IndexMask
+__glXDispSwap_Indexdv
+__glXDispSwap_Indexfv
+__glXDispSwap_Indexiv
+__glXDispSwap_Indexsv
+__glXDispSwap_Indexubv
+__glXDispSwap_InitNames
+__glXDispSwap_LightModelf
+__glXDispSwap_LightModelfv
+__glXDispSwap_LightModeli
+__glXDispSwap_LightModeliv
+__glXDispSwap_Lightf
+__glXDispSwap_Lightfv
+__glXDispSwap_Lighti
+__glXDispSwap_Lightiv
+__glXDispSwap_LineStipple
+__glXDispSwap_LineWidth
+__glXDispSwap_ListBase
+__glXDispSwap_LoadIdentity
+__glXDispSwap_LoadMatrixd
+__glXDispSwap_LoadMatrixf
+__glXDispSwap_LoadName
+__glXDispSwap_LogicOp
+__glXDispSwap_MapGrid1d
+__glXDispSwap_MapGrid1f
+__glXDispSwap_MapGrid2d
+__glXDispSwap_MapGrid2f
+__glXDispSwap_Materialf
+__glXDispSwap_Materialfv
+__glXDispSwap_Materiali
+__glXDispSwap_Materialiv
+__glXDispSwap_MatrixMode
+__glXDispSwap_MultMatrixd
+__glXDispSwap_MultMatrixf
+__glXDispSwap_Normal3bv
+__glXDispSwap_Normal3dv
+__glXDispSwap_Normal3fv
+__glXDispSwap_Normal3iv
+__glXDispSwap_Normal3sv
+__glXDispSwap_Ortho
+__glXDispSwap_PassThrough
+__glXDispSwap_PixelMapfv
+__glXDispSwap_PixelMapuiv
+__glXDispSwap_PixelMapusv
+__glXDispSwap_PixelTransferf
+__glXDispSwap_PixelTransferi
+__glXDispSwap_PixelZoom
+__glXDispSwap_PointSize
+__glXDispSwap_PolygonMode
+__glXDispSwap_PolygonOffset
+__glXDispSwap_PopAttrib
+__glXDispSwap_PopMatrix
+__glXDispSwap_PopName
+__glXDispSwap_PrioritizeTextures
+__glXDispSwap_PushAttrib
+__glXDispSwap_PushMatrix
+__glXDispSwap_PushName
+__glXDispSwap_RasterPos2dv
+__glXDispSwap_RasterPos2fv
+__glXDispSwap_RasterPos2iv
+__glXDispSwap_RasterPos2sv
+__glXDispSwap_RasterPos3dv
+__glXDispSwap_RasterPos3fv
+__glXDispSwap_RasterPos3iv
+__glXDispSwap_RasterPos3sv
+__glXDispSwap_RasterPos4dv
+__glXDispSwap_RasterPos4fv
+__glXDispSwap_RasterPos4iv
+__glXDispSwap_RasterPos4sv
+__glXDispSwap_ReadBuffer
+__glXDispSwap_Rectdv
+__glXDispSwap_Rectfv
+__glXDispSwap_Rectiv
+__glXDispSwap_Rectsv
+__glXDispSwap_Rotated
+__glXDispSwap_Rotatef
+__glXDispSwap_Scaled
+__glXDispSwap_Scalef
+__glXDispSwap_Scissor
+__glXDispSwap_ShadeModel
+__glXDispSwap_StencilFunc
+__glXDispSwap_StencilMask
+__glXDispSwap_StencilOp
+__glXDispSwap_TexCoord1dv
+__glXDispSwap_TexCoord1fv
+__glXDispSwap_TexCoord1iv
+__glXDispSwap_TexCoord1sv
+__glXDispSwap_TexCoord2dv
+__glXDispSwap_TexCoord2fv
+__glXDispSwap_TexCoord2iv
+__glXDispSwap_TexCoord2sv
+__glXDispSwap_TexCoord3dv
+__glXDispSwap_TexCoord3fv
+__glXDispSwap_TexCoord3iv
+__glXDispSwap_TexCoord3sv
+__glXDispSwap_TexCoord4dv
+__glXDispSwap_TexCoord4fv
+__glXDispSwap_TexCoord4iv
+__glXDispSwap_TexCoord4sv
+__glXDispSwap_TexEnvf
+__glXDispSwap_TexEnvfv
+__glXDispSwap_TexEnvi
+__glXDispSwap_TexEnviv
+__glXDispSwap_TexGend
+__glXDispSwap_TexGendv
+__glXDispSwap_TexGenf
+__glXDispSwap_TexGenfv
+__glXDispSwap_TexGeni
+__glXDispSwap_TexGeniv
+__glXDispSwap_TexParameterf
+__glXDispSwap_TexParameterfv
+__glXDispSwap_TexParameteri
+__glXDispSwap_TexParameteriv
+__glXDispSwap_Translated
+__glXDispSwap_Translatef
+__glXDispSwap_Vertex2dv
+__glXDispSwap_Vertex2fv
+__glXDispSwap_Vertex2iv
+__glXDispSwap_Vertex2sv
+__glXDispSwap_Vertex3dv
+__glXDispSwap_Vertex3fv
+__glXDispSwap_Vertex3iv
+__glXDispSwap_Vertex3sv
+__glXDispSwap_Vertex4dv
+__glXDispSwap_Vertex4fv
+__glXDispSwap_Vertex4iv
+__glXDispSwap_Vertex4sv
+__glXDispSwap_Viewport
+__glXDisp_AreTexturesResident
+__glXDisp_DeleteLists
+__glXDisp_DeleteTextures
+__glXDisp_EndList
+__glXDisp_GenLists
+__glXDisp_GenTextures
+__glXDisp_GetBooleanv
+__glXDisp_GetDoublev
+__glXDisp_GetError
+__glXDisp_GetFloatv
+__glXDisp_GetIntegerv
+__glXDisp_GetLightfv
+__glXDisp_GetLightiv
+__glXDisp_GetMapdv
+__glXDisp_GetMapfv
+__glXDisp_GetMapiv
+__glXDisp_GetMaterialfv
+__glXDisp_GetMaterialiv
+__glXDisp_GetPixelMapfv
+__glXDisp_GetPixelMapuiv
+__glXDisp_GetPixelMapusv
+__glXDisp_GetTexEnvfv
+__glXDisp_GetTexEnviv
+__glXDisp_GetTexGendv
+__glXDisp_GetTexGenfv
+__glXDisp_GetTexGeniv
+__glXDisp_GetTexLevelParameterfv
+__glXDisp_GetTexLevelParameteriv
+__glXDisp_GetTexParameterfv
+__glXDisp_GetTexParameteriv
+__glXDisp_IsEnabled
+__glXDisp_IsList
+__glXDisp_IsTexture
+__glXDisp_NewList
+__glXDisp_PixelStoref
+__glXDisp_PixelStorei
+__glXDispSwap_AreTexturesResident
+__glXDispSwap_DeleteLists
+__glXDispSwap_DeleteTextures
+__glXDispSwap_EndList
+__glXDispSwap_GenLists
+__glXDispSwap_GenTextures
+__glXDispSwap_GetBooleanv
+__glXDispSwap_GetDoublev
+__glXDispSwap_GetError
+__glXDispSwap_GetFloatv
+__glXDispSwap_GetIntegerv
+__glXDispSwap_GetLightfv
+__glXDispSwap_GetLightiv
+__glXDispSwap_GetMapdv
+__glXDispSwap_GetMapfv
+__glXDispSwap_GetMapiv
+__glXDispSwap_GetMaterialfv
+__glXDispSwap_GetMaterialiv
+__glXDispSwap_GetPixelMapfv
+__glXDispSwap_GetPixelMapuiv
+__glXDispSwap_GetPixelMapusv
+__glXDispSwap_GetTexEnvfv
+__glXDispSwap_GetTexEnviv
+__glXDispSwap_GetTexGendv
+__glXDispSwap_GetTexGenfv
+__glXDispSwap_GetTexGeniv
+__glXDispSwap_GetTexLevelParameterfv
+__glXDispSwap_GetTexLevelParameteriv
+__glXDispSwap_GetTexParameterfv
+__glXDispSwap_GetTexParameteriv
+__glXDispSwap_IsEnabled
+__glXDispSwap_IsList
+__glXDispSwap_IsTexture
+__glXDispSwap_NewList
+__glXDispSwap_PixelStoref
+__glXDispSwap_PixelStorei
+
+/* $XFree86$ */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxbuf.c b/nx-X11/programs/Xserver/GL/glx/glxbuf.c
new file mode 100644
index 000000000..44be53614
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxbuf.c
@@ -0,0 +1,296 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.c,v 1.6 2001/03/25 05:32:01 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxbuf.h"
+#include "glxfb.h"
+#include "glxmem.h"
+#include "glxpix.h"
+
+void
+__glXFBInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
+{
+ __GLdrawablePrivate *glPriv;
+ GLint rgbBits;
+ GLint accumBits;
+
+ glPriv = &glxPriv->glPriv;
+ rgbBits = modes->rgbBits;
+ accumBits = modes->accumRedBits + modes->accumGreenBits +
+ modes->accumBlueBits + modes->accumAlphaBits;
+
+#if defined(__GL_ALIGNED_BUFFERS)
+ /* initialize pixel alignments (for more details see context.h) */
+ glPriv->xAlignment = 1;
+ glPriv->yAlignment = 1;
+#endif
+
+ glxPriv->swapBuffers = __glXFBMemSwapBuffers;
+
+ glPriv->yInverted = GL_TRUE; /* Y is upside-down */
+
+ if (modes->doubleBufferMode) {
+ if (modes->colorIndexMode) {
+ __glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
+ __glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
+ } else {
+ __glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
+ __glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
+ }
+ } else {
+ if (modes->colorIndexMode) {
+ __glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
+ } else {
+ __glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
+ }
+ }
+
+#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
+ if (modes->maxAuxBuffers > 0) {
+ GLint i;
+
+ for (i=0; i < modes->maxAuxBuffers; i++) {
+ if (modes->colorIndexMode) {
+ __glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
+ } else {
+ __glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
+ }
+ }
+ }
+#endif
+
+ if (modes->haveAccumBuffer) {
+ __glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
+ }
+ if (modes->haveDepthBuffer) {
+ __glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
+ }
+ if (modes->haveStencilBuffer) {
+ __glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
+ }
+}
+
+void
+__glXPixInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
+{
+ __GLdrawablePrivate *glPriv;
+ GLint rgbBits;
+ GLint accumBits;
+
+ assert(glxPriv->pGlxPixmap);
+
+ glPriv = &glxPriv->glPriv;
+ rgbBits = modes->rgbBits;
+ accumBits = modes->accumRedBits + modes->accumGreenBits +
+ modes->accumBlueBits + modes->accumAlphaBits;
+
+#if defined(__GL_ALIGNED_BUFFERS)
+ /* initialize pixel alignments (for more details see context.h) */
+ glPriv->xAlignment = 1;
+ glPriv->yAlignment = 1;
+#endif
+
+ glxPriv->swapBuffers = (GLboolean (*)(__GLXdrawablePrivate *))__glXNop;
+
+ glPriv->yInverted = GL_FALSE;
+
+ if (modes->doubleBufferMode) {
+ if (modes->colorIndexMode) {
+ __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
+ glxPriv->drawId, glxPriv->pGlxPixmap);
+ __glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
+ } else {
+ __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
+ glxPriv->drawId, glxPriv->pGlxPixmap);
+ __glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
+ }
+ } else {
+ if (modes->colorIndexMode) {
+ __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
+ glxPriv->drawId, glxPriv->pGlxPixmap);
+ } else {
+ __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
+ glxPriv->drawId, glxPriv->pGlxPixmap);
+ }
+ }
+
+#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
+ if (modes->maxAuxBuffers > 0) {
+ GLint i;
+
+ for (i=0; i < modes->maxAuxBuffers; i++) {
+ if (modes->colorIndexMode) {
+ __glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
+ } else {
+ __glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
+ }
+ }
+ }
+#endif
+
+ if (modes->haveAccumBuffer) {
+ __glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
+ }
+ if (modes->haveDepthBuffer) {
+ __glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
+ }
+ if (modes->haveStencilBuffer) {
+ __glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
+ }
+}
+
+
+#define __GLX_SET_ACCEL_BUFFER_MASK(bm) \
+ if (status == GL_FALSE) return GL_FALSE; \
+ if (status == GL_TRUE) accelBufferMask |= bm; \
+ /* for __GL_BUFFER_FALLBACK don't do anything */
+
+GLboolean
+__glXResizeBuffers(__GLdrawablePrivate *glPriv,
+ GLint x, GLint y, GLuint width, GLuint height)
+{
+ __GLcontextModes *modes;
+ __GLdrawableRegion *glRegion;
+ GLboolean status;
+ GLuint accelBufferMask;
+
+ modes = glPriv->modes;
+ accelBufferMask = 0;
+
+ status = (*glPriv->frontBuffer.resize)(&glPriv->frontBuffer,
+ x, y, width, height, glPriv,
+ __GL_FRONT_BUFFER_MASK);
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_FRONT_BUFFER_MASK);
+
+ if (modes->doubleBufferMode) {
+ status = (*glPriv->backBuffer.resize)(&glPriv->backBuffer,
+ x, y, width, height, glPriv,
+ __GL_BACK_BUFFER_MASK);
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_BACK_BUFFER_MASK);
+ }
+
+#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
+ if (modes->maxAuxBuffers > 0) {
+ GLint i;
+
+ for (i=0; i < modes->maxAuxBuffers; i++) {
+ status = (*glPriv->auxBuffers[i].resize)(&glPriv->auxBuffer[i],
+ x, y, width, height,
+ glPriv,
+ __GL_AUX_BUFFER_MASK(i));
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_AUX_BUFFER_MASK(i));
+ }
+ }
+#endif
+
+ if (modes->haveAccumBuffer) {
+ status = (*glPriv->accumBuffer.resize)(&glPriv->accumBuffer,
+ x, y, width, height, glPriv,
+ __GL_ACCUM_BUFFER_MASK);
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_ACCUM_BUFFER_MASK);
+ }
+
+ if (modes->haveDepthBuffer) {
+ status = (*glPriv->depthBuffer.resize)(&glPriv->depthBuffer,
+ x, y, width, height, glPriv,
+ __GL_DEPTH_BUFFER_MASK);
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_DEPTH_BUFFER_MASK);
+ }
+
+ if (modes->haveStencilBuffer) {
+ status = (*glPriv->stencilBuffer.resize)(&glPriv->stencilBuffer,
+ x, y, width, height, glPriv,
+ __GL_STENCIL_BUFFER_MASK);
+ __GLX_SET_ACCEL_BUFFER_MASK(__GL_STENCIL_BUFFER_MASK);
+ }
+
+ glPriv->accelBufferMask = accelBufferMask;
+
+ /* finally, update the ownership region */
+ glRegion = &glPriv->ownershipRegion;
+ glRegion->numRects = 1;
+ glRegion->rects[0].x0 = 0;
+ glRegion->rects[0].y0 = 0;
+ glRegion->rects[0].x1 = width;
+ glRegion->rects[0].y1 = height;
+
+ return GL_TRUE;
+}
+
+void
+__glXFreeBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
+ __GLcontextModes *modes = glPriv->modes;
+#endif
+
+ if (glPriv->frontBuffer.free) {
+ (*glPriv->frontBuffer.free)(&glPriv->frontBuffer, glPriv);
+ }
+ if (glPriv->backBuffer.free) {
+ (*glPriv->backBuffer.free)(&glPriv->backBuffer, glPriv);
+ }
+
+#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
+ if (modes->maxAuxBuffers > 0) {
+ GLint i;
+
+ for (i=0; i < modes->maxAuxBuffers; i++) {
+ if (glPriv->auxBuffer[i].free) {
+ (*glPriv->auxBuffer[i].free)(&glPriv->auxBuffer[i], glPriv);
+ }
+ }
+ }
+#endif
+
+ if (glPriv->accumBuffer.free) {
+ (*glPriv->accumBuffer.free)(&glPriv->accumBuffer, glPriv);
+ }
+
+ if (glPriv->depthBuffer.free) {
+ (*glPriv->depthBuffer.free)(&glPriv->depthBuffer, glPriv);
+ }
+
+ if (glPriv->stencilBuffer.free) {
+ (*glPriv->stencilBuffer.free)(&glPriv->stencilBuffer, glPriv);
+ }
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxbuf.h b/nx-X11/programs/Xserver/GL/glx/glxbuf.h
new file mode 100644
index 000000000..88b04e8bd
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxbuf.h
@@ -0,0 +1,57 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxbuf_h_
+#define _glxbuf_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void __glXFBInitDrawable(__GLXdrawablePrivate *glxPriv,
+ __GLcontextModes *modes);
+extern void __glXPixInitDrawable(__GLXdrawablePrivate *glxPriv,
+ __GLcontextModes *modes);
+
+extern GLboolean __glXResizeBuffers(__GLdrawablePrivate *glPriv,
+ GLint x, GLint y,
+ GLuint width, GLuint height);
+
+extern void __glXFreeBuffers(__GLXdrawablePrivate *glxPriv);
+extern void __glXUpdatePalette(__GLXdrawablePrivate *);
+
+#endif /* _glxbuf_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c
new file mode 100644
index 000000000..ca5eee82a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c
@@ -0,0 +1,2156 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.12 2004/01/28 18:11:50 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#define FONT_PCF
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include <GL/glxtokens.h>
+#include <unpack.h>
+#include "g_disptab.h"
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include "g_disptab_EXT.h"
+#include "glximports.h"
+#include "glxutil.h"
+#include "glxext.h"
+#include "GL/glx_ansic.h"
+#include "glcontextmodes.h"
+
+/************************************************************************/
+
+static __GLimports imports = {
+ __glXImpMalloc,
+ __glXImpCalloc,
+ __glXImpRealloc,
+ __glXImpFree,
+ __glXImpWarning,
+ __glXImpFatal,
+ __glXImpGetenv,
+ __glXImpAtoi,
+ __glXImpSprintf,
+ __glXImpFopen,
+ __glXImpFclose,
+ __glXImpFprintf,
+ __glXImpGetDrawablePrivate,
+ __glXImpGetReadablePrivate,
+ NULL
+};
+
+static int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
+
+static int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc);
+static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+
+
+/************************************************************************/
+
+/**
+ * Create a GL context with the given properties. This routine is used
+ * to implement \c glXCreateContext, \c glXCreateNewContext, and
+ * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way
+ * that GLXFBConfigs are implemented. Basically, the FBConfigID is the
+ * same as the VisualID.
+ */
+
+int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
+ GLXContextID shareList, VisualID visual,
+ GLuint screen, GLboolean isDirect)
+{
+ ClientPtr client = cl->client;
+ VisualPtr pVisual;
+ ScreenPtr pScreen;
+ __GLXcontext *glxc, *shareglxc;
+ __GLcontextModes *modes;
+ __GLXscreenInfo *pGlxScreen;
+ __GLinterface *shareGC;
+ GLint i;
+
+ LEGAL_NEW_RESOURCE(gcId, client);
+
+ /*
+ ** Check if screen exists.
+ */
+ if (screen >= screenInfo.numScreens) {
+ client->errorValue = screen;
+ return BadValue;
+ }
+ pScreen = screenInfo.screens[screen];
+ pGlxScreen = &__glXActiveScreens[screen];
+
+ /*
+ ** Check if the visual ID is valid for this screen.
+ */
+ pVisual = pScreen->visuals;
+ for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
+ if (pVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pScreen->numVisuals) {
+ client->errorValue = visual;
+ return BadValue;
+ }
+
+ /*
+ ** Get configuration of the visual. This assumes that the
+ ** glXActiveScreens structure contains visual configurations only for the
+ ** subset of Visuals that are supported by this implementation of the
+ ** OpenGL.
+ */
+
+ modes = _gl_context_modes_find_visual( pGlxScreen->modes, visual );
+ if (modes == NULL) {
+ /*
+ ** Visual not support on this screen by this OpenGL implementation.
+ */
+ client->errorValue = visual;
+ return BadValue;
+ }
+
+ /*
+ ** Find the display list space that we want to share.
+ **
+ ** NOTE: In a multithreaded X server, we would need to keep a reference
+ ** count for each display list so that if one client detroyed a list that
+ ** another client was using, the list would not really be freed until it
+ ** was no longer in use. Since this sample implementation has no support
+ ** for multithreaded servers, we don't do this.
+ */
+ if (shareList == None) {
+ shareGC = 0;
+ } else {
+ shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes);
+ if (!shareglxc) {
+ client->errorValue = shareList;
+ return __glXBadContext;
+ }
+ if (shareglxc->isDirect) {
+ /*
+ ** NOTE: no support for sharing display lists between direct
+ ** contexts, even if they are in the same address space.
+ */
+#if 0
+ /* Disabling this code seems to allow shared display lists
+ * and texture objects to work. We'll leave it disabled for now.
+ */
+ client->errorValue = shareList;
+ return BadMatch;
+#endif
+ } else {
+ /*
+ ** Create an indirect context regardless of what the client asked
+ ** for; this way we can share display list space with shareList.
+ */
+ isDirect = GL_FALSE;
+ }
+ shareGC = shareglxc->gc;
+ }
+
+ /*
+ ** Allocate memory for the new context
+ */
+ glxc = (__GLXcontext *) __glXMalloc(sizeof(__GLXcontext));
+ if (!glxc) {
+ return BadAlloc;
+ }
+ __glXMemset(glxc, 0, sizeof(__GLXcontext));
+
+ /*
+ ** Initially, setup the part of the context that could be used by
+ ** a GL core that needs windowing information (e.g., Mesa).
+ */
+ glxc->pScreen = pScreen;
+ glxc->pGlxScreen = pGlxScreen;
+ glxc->pVisual = pVisual;
+ glxc->modes = modes;
+
+ if (!isDirect) {
+
+ /*
+ ** Allocate a GL context
+ */
+ imports.other = (void *)glxc;
+ glxc->gc = (*pGlxScreen->createContext)(&imports, glxc->modes, shareGC);
+ if (!glxc->gc) {
+ __glXFree(glxc);
+ client->errorValue = gcId;
+ return BadAlloc;
+ }
+ } else {
+ /*
+ ** Don't need local GL context for a direct context.
+ */
+ glxc->gc = 0;
+ }
+ /*
+ ** Register this context as a resource.
+ */
+ if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
+ if (!isDirect) {
+ (*glxc->gc->exports.destroyContext)((__GLcontext *)glxc->gc);
+ }
+ __glXFree(glxc);
+ client->errorValue = gcId;
+ return BadAlloc;
+ }
+
+ /*
+ ** Finally, now that everything is working, setup the rest of the
+ ** context.
+ */
+ glxc->id = gcId;
+ glxc->share_id = shareList;
+ glxc->idExists = GL_TRUE;
+ glxc->isCurrent = GL_FALSE;
+ glxc->isDirect = isDirect;
+ glxc->renderMode = GL_RENDER;
+
+ return Success;
+}
+
+
+int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
+ return DoCreateContext( cl, req->context, req->shareList, req->visual,
+ req->screen, req->isDirect );
+}
+
+
+int __glXCreateNewContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+ return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
+ req->screen, req->isDirect );
+}
+
+
+int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
+ return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
+ req->screen, req->isDirect );
+}
+
+/*
+** Destroy a GL context as an X resource.
+*/
+int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
+ GLXContextID gcId = req->context;
+ __GLXcontext *glxc;
+
+ glxc = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes);
+ if (glxc) {
+ /*
+ ** Just free the resource; don't actually destroy the context,
+ ** because it might be in use. The
+ ** destroy method will be called by the resource destruction routine
+ ** if necessary.
+ */
+ FreeResourceByType(gcId, __glXContextRes, FALSE);
+ return Success;
+ } else {
+ client->errorValue = gcId;
+ return __glXBadContext;
+ }
+}
+
+/*****************************************************************************/
+
+/*
+** For each client, the server keeps a table of all the contexts that are
+** current for that client (each thread of a client may have its own current
+** context). These routines add, change, and lookup contexts in the table.
+*/
+
+/*
+** Add a current context, and return the tag that will be used to refer to it.
+*/
+static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc)
+{
+ int i;
+ int num = cl->numCurrentContexts;
+ __GLXcontext **table = cl->currentContexts;
+
+ if (!glxc) return -1;
+
+ /*
+ ** Try to find an empty slot and use it.
+ */
+ for (i=0; i < num; i++) {
+ if (!table[i]) {
+ table[i] = glxc;
+ return i+1;
+ }
+ }
+ /*
+ ** Didn't find a free slot, so we'll have to grow the table.
+ */
+ if (!num) {
+ table = (__GLXcontext **) __glXMalloc(sizeof(__GLXcontext *));
+ } else {
+ table = (__GLXcontext **) __glXRealloc(table,
+ (num+1)*sizeof(__GLXcontext *));
+ }
+ table[num] = glxc;
+ cl->currentContexts = table;
+ cl->numCurrentContexts++;
+ return num+1;
+}
+
+/*
+** Given a tag, change the current context for the corresponding entry.
+*/
+static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc,
+ GLXContextTag tag)
+{
+ __GLXcontext **table = cl->currentContexts;
+ table[tag-1] = glxc;
+}
+
+/*
+** For this implementation we have chosen to simply use the index of the
+** context's entry in the table as the context tag. A tag must be greater
+** than 0.
+*/
+__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
+{
+ int num = cl->numCurrentContexts;
+
+ if (tag < 1 || tag > num) {
+ return 0;
+ } else {
+ return cl->currentContexts[tag-1];
+ }
+}
+
+/*****************************************************************************/
+
+static void StopUsingContext(__GLXcontext *glxc)
+{
+ if (glxc) {
+ if (glxc == __glXLastContext) {
+ /* Tell server GL library */
+ __glXLastContext = 0;
+ }
+ glxc->isCurrent = GL_FALSE;
+ if (!glxc->idExists) {
+ __glXFreeContext(glxc);
+ }
+ }
+}
+
+static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc)
+{
+ glxc->isCurrent = GL_TRUE;
+}
+
+/*****************************************************************************/
+/*
+** Make an OpenGL context and drawable current.
+*/
+
+int __glXMakeCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+
+ return DoMakeCurrent( cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+
+ return DoMakeCurrent( cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+
+ return DoMakeCurrent( cl, req->drawable, req->readable,
+ req->context, req->oldContextTag );
+}
+
+
+/**
+ * Given a drawable ID, get the associated drawable and / or pixmap.
+ *
+ * If the specified drawable ID is not a pixmap, \c ppPixmap will be set
+ * to \c NULL on return. In either case, \c ppDraw will be set to a drawable.
+ * In the case where the drawable ID is a pixmap, \c ppDraw will be set to
+ * the drawable associated with that pixmap.
+ *
+ * \param glxc Associated GLX context.
+ * \param drawId ID of the drawable.
+ * \param ppDraw Location to store the pointer to the drawable.
+ * \param ppPixmap Location to store the pointer to the pixmap.
+ * \param client Pointer to the client state.
+ * \return Zero is returned on success. Otherwise a GLX / X11 protocol error
+ * is returned.
+ *
+ * \notes This function will need some modification when support pbuffers
+ * is added.
+ */
+static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
+ DrawablePtr *ppDraw, __GLXpixmap **ppPixmap,
+ ClientPtr client )
+{
+ DrawablePtr pDraw;
+ __GLXpixmap *drawPixmap = NULL;
+
+ pDraw = (DrawablePtr) LookupDrawable(drawId, client);
+ if (pDraw) {
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X Window.
+ */
+ WindowPtr pWin = (WindowPtr)pDraw;
+ VisualID vid = wVisual(pWin);
+
+ /*
+ ** Check if window and context are similar.
+ */
+ if ((vid != glxc->pVisual->vid) ||
+ (pWin->drawable.pScreen != glxc->pScreen)) {
+ client->errorValue = drawId;
+ return BadMatch;
+ }
+ } else {
+ /*
+ ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
+ ** is, but it must first be created with glxCreateGLXPixmap).
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ } else {
+ drawPixmap = (__GLXpixmap *) LookupIDByType(drawId, __glXPixmapRes);
+ if (drawPixmap) {
+ /*
+ ** Check if pixmap and context are similar.
+ */
+ if (drawPixmap->pScreen != glxc->pScreen ||
+ drawPixmap->modes->visualID != glxc->modes->visualID) {
+ client->errorValue = drawId;
+ return BadMatch;
+ }
+ pDraw = drawPixmap->pDraw;
+
+ } else {
+ /*
+ ** Drawable is neither a Window nor a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
+
+ *ppPixmap = drawPixmap;
+ *ppDraw = pDraw;
+
+ return 0;
+}
+
+
+int DoMakeCurrent( __GLXclientState *cl,
+ GLXDrawable drawId, GLXDrawable readId,
+ GLXContextID contextId, GLXContextTag tag )
+{
+ ClientPtr client = cl->client;
+ DrawablePtr pDraw;
+ DrawablePtr pRead;
+ xGLXMakeCurrentReply reply;
+ __GLXpixmap *drawPixmap = NULL;
+ __GLXpixmap *readPixmap = NULL;
+ __GLXcontext *glxc, *prevglxc;
+ __GLinterface *gc, *prevgc;
+ __GLXdrawablePrivate *drawPriv = NULL;
+ __GLXdrawablePrivate *readPriv = NULL;
+ GLint error;
+ GLuint mask;
+
+ /*
+ ** If one is None and the other isn't, it's a bad match.
+ */
+
+ mask = (drawId == None) ? (1 << 0) : 0;
+ mask |= (readId == None) ? (1 << 1) : 0;
+ mask |= (contextId == None) ? (1 << 2) : 0;
+
+ if ( (mask != 0x00) && (mask != 0x07) ) {
+ return BadMatch;
+ }
+
+ /*
+ ** Lookup old context. If we have one, it must be in a usable state.
+ */
+ if (tag != 0) {
+ prevglxc = __glXLookupContextByTag(cl, tag);
+ if (!prevglxc) {
+ /*
+ ** Tag for previous context is invalid.
+ */
+ return __glXBadContextTag;
+ }
+ if (prevglxc->renderMode != GL_RENDER) {
+ /* Oops. Not in render mode render. */
+ client->errorValue = prevglxc->id;
+ return __glXBadContextState;
+ }
+ prevgc = prevglxc->gc;
+ } else {
+ prevglxc = 0;
+ prevgc = 0;
+ }
+
+ /*
+ ** Lookup new context. It must not be current for someone else.
+ */
+ if (contextId != None) {
+ int status;
+
+ glxc = (__GLXcontext *) LookupIDByType(contextId, __glXContextRes);
+ if (!glxc) {
+ client->errorValue = contextId;
+ return __glXBadContext;
+ }
+ if ((glxc != prevglxc) && glxc->isCurrent) {
+ /* Context is current to somebody else */
+ return BadAccess;
+ }
+ gc = glxc->gc;
+
+
+ assert( drawId != None );
+ assert( readId != None );
+
+ status = GetDrawableOrPixmap( glxc, drawId, & pDraw, & drawPixmap,
+ client );
+ if ( status != 0 ) {
+ return status;
+ }
+
+ if ( readId != drawId ) {
+ status = GetDrawableOrPixmap( glxc, readId, & pRead, & readPixmap,
+ client );
+ if ( status != 0 ) {
+ return status;
+ }
+ } else {
+ pRead = pDraw;
+ }
+
+ /* FIXME: Finish refactoring this. - idr */
+ /* get the drawable private */
+ if (pDraw) {
+ drawPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
+ if (drawPriv == NULL) {
+ return __glXBadDrawable;
+ }
+ }
+
+ if (pRead != pDraw) {
+ readPriv = __glXGetDrawablePrivate(pRead, readId, glxc->modes);
+ if (readPriv == NULL) {
+ return __glXBadDrawable;
+ }
+ } else {
+ readPriv = drawPriv;
+ }
+
+ } else {
+ /* Switching to no context. Ignore new drawable. */
+ glxc = 0;
+ gc = 0;
+ pDraw = 0;
+ pRead = 0;
+ }
+
+
+ if (prevglxc) {
+ /*
+ ** Flush the previous context if needed.
+ */
+ if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
+ if (__glXForceCurrent(cl, tag, (int *)&error)) {
+ glFlush();
+ __GLX_NOTE_FLUSHED_CMDS(prevglxc);
+ } else {
+ return error;
+ }
+ }
+
+ /*
+ ** Make the previous context not current.
+ */
+ if (!(*prevgc->exports.loseCurrent)((__GLcontext *)prevgc)) {
+ return __glXBadContext;
+ }
+ __glXDeassociateContext(prevglxc);
+ }
+
+
+ if ((glxc != 0) && !glxc->isDirect) {
+
+ glxc->drawPriv = drawPriv;
+ glxc->readPriv = readPriv;
+ __glXCacheDrawableSize(drawPriv);
+
+ /* make the context current */
+ if (!(*gc->exports.makeCurrent)((__GLcontext *)gc)) {
+ glxc->drawPriv = NULL;
+ glxc->readPriv = NULL;
+ return __glXBadContext;
+ }
+
+ /* resize the buffers */
+ if (!__glXResizeDrawableBuffers(drawPriv)) {
+ /* could not do initial resize. make current failed */
+ (*gc->exports.loseCurrent)((__GLcontext *)gc);
+ glxc->drawPriv = NULL;
+ glxc->readPriv = NULL;
+ return __glXBadContext;
+ }
+
+ glxc->isCurrent = GL_TRUE;
+ __glXAssociateContext(glxc);
+ assert(drawPriv->drawGlxc == glxc);
+ assert(readPriv->readGlxc == glxc);
+ }
+
+ if (prevglxc) {
+ if (prevglxc->drawPixmap) {
+ if (prevglxc->readPixmap &&
+ prevglxc->drawPixmap != prevglxc->readPixmap) {
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ prevglxc->readPixmap->refcnt--;
+ if (!prevglxc->readPixmap->idExists &&
+ !prevglxc->readPixmap->refcnt) {
+ PixmapPtr pPixmap = (PixmapPtr) prevglxc->readPixmap->pDraw;
+ /*
+ ** The DestroyPixmap routine should decrement the
+ ** refcount of the X pixmap and free only if it's zero.
+ */
+ (*prevglxc->readPixmap->pScreen->DestroyPixmap)(pPixmap);
+ __glXFree(prevglxc->readPixmap);
+ }
+ }
+
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ prevglxc->drawPixmap->refcnt--;
+ if (!prevglxc->drawPixmap->idExists &&
+ !prevglxc->drawPixmap->refcnt) {
+ PixmapPtr pPixmap = (PixmapPtr) prevglxc->drawPixmap->pDraw;
+ /*
+ ** The DestroyPixmap routine should decrement the
+ ** refcount of the X pixmap and free only if it's zero.
+ */
+ (*prevglxc->drawPixmap->pScreen->DestroyPixmap)(pPixmap);
+ __glXFree(prevglxc->drawPixmap);
+ }
+
+ prevglxc->drawPixmap = NULL;
+ }
+ ChangeCurrentContext(cl, glxc, tag);
+ StopUsingContext(prevglxc);
+ } else {
+ tag = AddCurrentContext(cl, glxc);
+ }
+
+ if (glxc) {
+ if (drawPixmap) {
+ drawPixmap->refcnt++;
+ glxc->drawPixmap = drawPixmap;
+ }
+
+ if (readPixmap && (readPixmap != drawPixmap)) {
+ readPixmap->refcnt++;
+ glxc->readPixmap = readPixmap;
+ }
+
+ StartUsingContext(cl, glxc);
+ reply.contextTag = tag;
+ } else {
+ reply.contextTag = 0;
+ }
+
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapMakeCurrentReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply);
+ }
+ return Success;
+}
+
+int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
+ xGLXIsDirectReply reply;
+ __GLXcontext *glxc;
+
+ /*
+ ** Find the GL context.
+ */
+ glxc = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
+ if (!glxc) {
+ client->errorValue = req->context;
+ return __glXBadContext;
+ }
+
+ reply.isDirect = glxc->isDirect;
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapIsDirectReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
+ }
+
+ return Success;
+}
+
+int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
+ xGLXQueryVersionReply reply;
+ GLuint major, minor;
+
+ major = req->majorVersion;
+ minor = req->minorVersion;
+ (void)major;
+ (void)minor;
+
+ /*
+ ** Server should take into consideration the version numbers sent by the
+ ** client if it wants to work with older clients; however, in this
+ ** implementation the server just returns its version number.
+ */
+ reply.majorVersion = GLX_SERVER_MAJOR_VERSION;
+ reply.minorVersion = GLX_SERVER_MINOR_VERSION;
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapQueryVersionReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply);
+ }
+ return Success;
+}
+
+int __glXWaitGL(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
+ int error;
+
+ if (!__glXForceCurrent(cl, req->contextTag, &error)) {
+ return error;
+ }
+ glFinish();
+ return Success;
+}
+
+int __glXWaitX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
+ int error;
+
+ if (!__glXForceCurrent(cl, req->contextTag, &error)) {
+ return error;
+ }
+ /*
+ ** In a multithreaded server that had separate X and GL threads, we would
+ ** have to wait for the X thread to finish before returning. As it stands,
+ ** this sample implementation only supports singlethreaded servers, and
+ ** nothing needs to be done here.
+ */
+ return Success;
+}
+
+int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
+ GLXContextID source = req->source;
+ GLXContextID dest = req->dest;
+ GLXContextTag tag = req->contextTag;
+ unsigned long mask = req->mask;
+ __GLXcontext *src, *dst;
+ int error;
+
+ /*
+ ** Check that each context exists.
+ */
+ src = (__GLXcontext *) LookupIDByType(source, __glXContextRes);
+ if (!src) {
+ client->errorValue = source;
+ return __glXBadContext;
+ }
+ dst = (__GLXcontext *) LookupIDByType(dest, __glXContextRes);
+ if (!dst) {
+ client->errorValue = dest;
+ return __glXBadContext;
+ }
+
+ /*
+ ** They must be in the same address space, and same screen.
+ ** NOTE: no support for direct rendering contexts here.
+ */
+ if (src->isDirect || dst->isDirect ||
+ (src->pGlxScreen != dst->pGlxScreen)) {
+ client->errorValue = source;
+ return BadMatch;
+ }
+
+ /*
+ ** The destination context must not be current for any client.
+ */
+ if (dst->isCurrent) {
+ client->errorValue = dest;
+ return BadAccess;
+ }
+
+ if (tag) {
+ __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag);
+
+ if (!tagcx) {
+ return __glXBadContextTag;
+ }
+ if (tagcx != src) {
+ /*
+ ** This would be caused by a faulty implementation of the client
+ ** library.
+ */
+ return BadMatch;
+ }
+ /*
+ ** In this case, glXCopyContext is in both GL and X streams, in terms
+ ** of sequentiality.
+ */
+ if (__glXForceCurrent(cl, tag, &error)) {
+ /*
+ ** Do whatever is needed to make sure that all preceding requests
+ ** in both streams are completed before the copy is executed.
+ */
+ glFinish();
+ __GLX_NOTE_FLUSHED_CMDS(tagcx);
+ } else {
+ return error;
+ }
+ }
+ /*
+ ** Issue copy. The only reason for failure is a bad mask.
+ */
+ if (!(*dst->gc->exports.copyContext)((__GLcontext *)dst->gc,
+ (__GLcontext *)src->gc,
+ mask)) {
+ client->errorValue = mask;
+ return BadValue;
+ }
+ return Success;
+}
+
+
+int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
+ GLboolean do_swap)
+{
+ ClientPtr client = cl->client;
+ xGLXGetVisualConfigsReply reply;
+ __GLXscreenInfo *pGlxScreen;
+ __GLcontextModes *modes;
+ CARD32 buf[__GLX_TOTAL_CONFIG];
+ int p;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ if (screen >= screenInfo.numScreens) {
+ /* The client library must send a valid screen number. */
+ client->errorValue = screen;
+ return BadValue;
+ }
+ pGlxScreen = &__glXActiveScreens[screen];
+
+ reply.numVisuals = pGlxScreen->numUsableVisuals;
+ reply.numProps = __GLX_TOTAL_CONFIG;
+ reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
+ __GLX_TOTAL_CONFIG) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if ( do_swap ) {
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numVisuals);
+ __GLX_SWAP_INT(&reply.numProps);
+ }
+
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
+
+ for ( modes = pGlxScreen->modes ; modes != NULL ; modes = modes->next ) {
+ if (modes->visualID == 0) {
+ /* not a usable visual */
+ continue;
+ }
+ p = 0;
+ buf[p++] = modes->visualID;
+ buf[p++] = _gl_convert_to_x_visual_type( modes->visualType );
+ buf[p++] = modes->rgbMode;
+
+ buf[p++] = modes->redBits;
+ buf[p++] = modes->greenBits;
+ buf[p++] = modes->blueBits;
+ buf[p++] = modes->alphaBits;
+ buf[p++] = modes->accumRedBits;
+ buf[p++] = modes->accumGreenBits;
+ buf[p++] = modes->accumBlueBits;
+ buf[p++] = modes->accumAlphaBits;
+
+ buf[p++] = modes->doubleBufferMode;
+ buf[p++] = modes->stereoMode;
+
+ buf[p++] = modes->rgbBits;
+ buf[p++] = modes->depthBits;
+ buf[p++] = modes->stencilBits;
+ buf[p++] = modes->numAuxBuffers;
+ buf[p++] = modes->level;
+ /*
+ ** Add token/value pairs for extensions.
+ */
+ buf[p++] = GLX_VISUAL_CAVEAT_EXT;
+ buf[p++] = modes->visualRating;
+ buf[p++] = GLX_TRANSPARENT_TYPE;
+ buf[p++] = modes->transparentPixel;
+ buf[p++] = GLX_TRANSPARENT_RED_VALUE;
+ buf[p++] = modes->transparentRed;
+ buf[p++] = GLX_TRANSPARENT_GREEN_VALUE;
+ buf[p++] = modes->transparentGreen;
+ buf[p++] = GLX_TRANSPARENT_BLUE_VALUE;
+ buf[p++] = modes->transparentBlue;
+ buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE;
+ buf[p++] = modes->transparentAlpha;
+ buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
+ buf[p++] = modes->transparentIndex;
+
+ if ( do_swap ) {
+ __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
+ }
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
+ (char *)buf);
+ }
+ return Success;
+}
+
+int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
+ return DoGetVisualConfigs( cl, req->screen, GL_FALSE );
+}
+
+
+
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (28)
+#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
+/**
+ * Send the set of GLXFBConfigs to the client. There is not currently
+ * and interface into the driver on the server-side to get GLXFBConfigs,
+ * so we "invent" some based on the \c __GLXvisualConfig structures that
+ * the driver does supply.
+ *
+ * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX
+ * is the same, so this routine pulls double duty.
+ */
+
+int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsReply reply;
+ __GLXscreenInfo *pGlxScreen;
+ CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
+ int p;
+ __GLcontextModes *modes;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+
+ if (screen >= screenInfo.numScreens) {
+ /* The client library must send a valid screen number. */
+ client->errorValue = screen;
+ return BadValue;
+ }
+ pGlxScreen = &__glXActiveScreens[screen];
+
+ reply.numFBConfigs = pGlxScreen->numUsableVisuals;
+ reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS;
+ reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs);
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if ( do_swap ) {
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numFBConfigs);
+ __GLX_SWAP_INT(&reply.numAttribs);
+ }
+
+ WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply);
+
+ for ( modes = pGlxScreen->modes ; modes != NULL ; modes = modes->next ) {
+ if (modes->visualID == 0) {
+ /* not a usable visual */
+ continue;
+ }
+ p = 0;
+
+#define WRITE_PAIR(tag,value) \
+ do { buf[p++] = tag ; buf[p++] = value ; } while( 0 )
+
+ WRITE_PAIR( GLX_VISUAL_ID, modes->visualID );
+ WRITE_PAIR( GLX_FBCONFIG_ID, modes->visualID );
+ WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE );
+
+ WRITE_PAIR( GLX_RGBA, modes->rgbMode );
+ WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode );
+ WRITE_PAIR( GLX_STEREO, modes->stereoMode );
+
+ WRITE_PAIR( GLX_BUFFER_SIZE, modes->rgbBits );
+ WRITE_PAIR( GLX_LEVEL, modes->level );
+ WRITE_PAIR( GLX_AUX_BUFFERS, modes->numAuxBuffers );
+ WRITE_PAIR( GLX_RED_SIZE, modes->redBits );
+ WRITE_PAIR( GLX_GREEN_SIZE, modes->greenBits );
+ WRITE_PAIR( GLX_BLUE_SIZE, modes->blueBits );
+ WRITE_PAIR( GLX_ALPHA_SIZE, modes->alphaBits );
+ WRITE_PAIR( GLX_ACCUM_RED_SIZE, modes->accumRedBits );
+ WRITE_PAIR( GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits );
+ WRITE_PAIR( GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits );
+ WRITE_PAIR( GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits );
+ WRITE_PAIR( GLX_DEPTH_SIZE, modes->depthBits );
+ WRITE_PAIR( GLX_STENCIL_SIZE, modes->stencilBits );
+
+ WRITE_PAIR( GLX_X_VISUAL_TYPE, modes->visualType );
+
+ /*
+ ** Add token/value pairs for extensions.
+ */
+ WRITE_PAIR( GLX_CONFIG_CAVEAT, modes->visualRating );
+ WRITE_PAIR( GLX_TRANSPARENT_TYPE, modes->transparentPixel );
+ WRITE_PAIR( GLX_TRANSPARENT_RED_VALUE, modes->transparentRed );
+ WRITE_PAIR( GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen );
+ WRITE_PAIR( GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue );
+ WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
+ WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
+ WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
+
+ if ( do_swap ) {
+ __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);
+ }
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH,
+ (char *)buf);
+ }
+ return Success;
+}
+
+
+int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
+ return DoGetFBConfigs( cl, req->screen, GL_FALSE );
+}
+
+
+int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ return DoGetFBConfigs( cl, req->screen, GL_FALSE );
+}
+
+
+/*
+** Create a GLX Pixmap from an X Pixmap.
+*/
+int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
+ GLuint screenNum, XID pixmapId, XID glxpixmapId)
+{
+ ClientPtr client = cl->client;
+ DrawablePtr pDraw;
+ ScreenPtr pScreen;
+ VisualPtr pVisual;
+ __GLXpixmap *pGlxPixmap;
+ __GLXscreenInfo *pGlxScreen;
+ __GLcontextModes *modes;
+ int i;
+
+ LEGAL_NEW_RESOURCE(glxpixmapId, client);
+
+ pDraw = (DrawablePtr) LookupDrawable(pixmapId, client);
+ if (!pDraw || pDraw->type != DRAWABLE_PIXMAP) {
+ client->errorValue = pixmapId;
+ return BadPixmap;
+ }
+
+ /*
+ ** Check if screen of visual matches screen of pixmap.
+ */
+ pScreen = pDraw->pScreen;
+ if (screenNum != pScreen->myNum) {
+ return BadMatch;
+ }
+
+ /*
+ ** Find the VisualRec for this visual.
+ */
+ pVisual = pScreen->visuals;
+ for (i=0; i < pScreen->numVisuals; i++, pVisual++) {
+ if (pVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pScreen->numVisuals) {
+ client->errorValue = visual;
+ return BadValue;
+ }
+ /*
+ ** Check if depth of visual matches depth of pixmap.
+ */
+ if (pVisual->nplanes != pDraw->depth) {
+ return BadMatch;
+ }
+
+ /*
+ ** Get configuration of the visual.
+ */
+ pGlxScreen = &__glXActiveScreens[screenNum];
+ modes = _gl_context_modes_find_visual( pGlxScreen->modes, visual );
+ if (modes == NULL) {
+ /*
+ ** Visual not support on this screen by this OpenGL implementation.
+ */
+ client->errorValue = visual;
+ return BadValue;
+ }
+
+ pGlxPixmap = (__GLXpixmap *) __glXMalloc(sizeof(__GLXpixmap));
+ if (!pGlxPixmap) {
+ return BadAlloc;
+ }
+ if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
+ return BadAlloc;
+ }
+ pGlxPixmap->pDraw = pDraw;
+ pGlxPixmap->pGlxScreen = pGlxScreen;
+ pGlxPixmap->pScreen = pScreen;
+ pGlxPixmap->idExists = True;
+ pGlxPixmap->refcnt = 0;
+
+ pGlxPixmap->modes = modes;
+
+ /*
+ ** Bump the ref count on the X pixmap so it won't disappear.
+ */
+ ((PixmapPtr) pDraw)->refcnt++;
+
+ return Success;
+}
+
+int __glXCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
+ return DoCreateGLXPixmap( cl, req->visual, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+int __glXCreatePixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+ return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+int __glXCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateGLXPixmapWithConfigSGIXReq *req =
+ (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
+ return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+
+/**
+ * Destroy a GLX pixmap. This function is used for both
+ * \c glXDestroyGLXPixmap and \c glXDestroyPixmap.
+ */
+
+int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+ XID glxpixmap = req->glxpixmap;
+
+ /*
+ ** Check if it's a valid GLX pixmap.
+ */
+ if (!LookupIDByType(glxpixmap, __glXPixmapRes)) {
+ client->errorValue = glxpixmap;
+ return __glXBadPixmap;
+ }
+ FreeResource(glxpixmap, FALSE);
+ return Success;
+}
+
+/*****************************************************************************/
+
+/*
+** NOTE: There is no portable implementation for swap buffers as of
+** this time that is of value. Consequently, this code must be
+** implemented by somebody other than SGI.
+*/
+int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ DrawablePtr pDraw;
+ xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
+ GLXContextTag tag = req->contextTag;
+ XID drawId = req->drawable;
+ __GLXpixmap *pGlxPixmap;
+ __GLXcontext *glxc = NULL;
+ int error;
+
+ /*
+ ** Check that the GLX drawable is valid.
+ */
+ pDraw = (DrawablePtr) LookupDrawable(drawId, client);
+ if (pDraw) {
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X window.
+ */
+ } else {
+ /*
+ ** Drawable is an X pixmap, which is not allowed.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ } else {
+ pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
+ __glXPixmapRes);
+ if (pGlxPixmap) {
+ /*
+ ** Drawable is a GLX pixmap.
+ */
+ } else {
+ /*
+ ** Drawable is neither a X window nor a GLX pixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
+
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc) {
+ return __glXBadContextTag;
+ }
+ /*
+ ** The calling thread is swapping its current drawable. In this case,
+ ** glxSwapBuffers is in both GL and X streams, in terms of
+ ** sequentiality.
+ */
+ if (__glXForceCurrent(cl, tag, &error)) {
+ /*
+ ** Do whatever is needed to make sure that all preceding requests
+ ** in both streams are completed before the swap is executed.
+ */
+ glFinish();
+ __GLX_NOTE_FLUSHED_CMDS(glxc);
+ } else {
+ return error;
+ }
+ }
+
+ if (pDraw) {
+ __GLXdrawablePrivate *glxPriv;
+
+ if (glxc) {
+ glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
+ if (glxPriv == NULL) {
+ return __glXBadDrawable;
+ }
+ }
+ else {
+ glxPriv = __glXFindDrawablePrivate(drawId);
+ if (glxPriv == NULL) {
+ /* This is a window we've never seen before, do nothing */
+ return Success;
+ }
+ }
+
+ if ((*glxPriv->swapBuffers)(glxPriv) == GL_FALSE) {
+ return __glXBadDrawable;
+ }
+ }
+
+ return Success;
+}
+
+
+int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ __GLXcontext *ctx;
+ xGLXQueryContextInfoEXTReq *req;
+ xGLXQueryContextInfoEXTReply reply;
+ int nProps;
+ int *sendBuf, *pSendBuf;
+ int nReplyBytes;
+
+ req = (xGLXQueryContextInfoEXTReq *)pc;
+ ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
+ if (!ctx) {
+ client->errorValue = req->context;
+ return __glXBadContext;
+ }
+
+ nProps = 3;
+ reply.length = nProps << 1;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.n = nProps;
+
+ nReplyBytes = reply.length << 2;
+ sendBuf = (int *)__glXMalloc((size_t)nReplyBytes);
+ if (sendBuf == NULL) {
+ return __glXBadContext; /* XXX: Is this correct? */
+ }
+ pSendBuf = sendBuf;
+ *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
+ *pSendBuf++ = (int)(ctx->share_id);
+ *pSendBuf++ = GLX_VISUAL_ID_EXT;
+ *pSendBuf++ = (int)(ctx->pVisual->vid);
+ *pSendBuf++ = GLX_SCREEN_EXT;
+ *pSendBuf++ = (int)(ctx->pScreen->myNum);
+
+ if (client->swapped) {
+ __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
+ WriteToClient(client, nReplyBytes, (char *)sendBuf);
+ }
+ __glXFree((char *)sendBuf);
+
+ return Success;
+}
+
+
+/************************************************************************/
+
+/*
+** Render and Renderlarge are not in the GLX API. They are used by the GLX
+** client library to send batches of GL rendering commands.
+*/
+
+/*
+** Execute all the drawing commands in a request.
+*/
+int __glXRender(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderReq *req;
+ ClientPtr client= cl->client;
+ int left, cmdlen, error;
+ int commandsDone;
+ CARD16 opcode;
+ __GLXrenderHeader *hdr;
+ __GLXcontext *glxc;
+
+ /*
+ ** NOTE: much of this code also appears in the byteswapping version of this
+ ** routine, __glXSwapRender(). Any changes made here should also be
+ ** duplicated there.
+ */
+
+ req = (xGLXRenderReq *) pc;
+ glxc = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!glxc) {
+ return error;
+ }
+
+ commandsDone = 0;
+ pc += sz_xGLXRenderReq;
+ left = (req->length << 2) - sz_xGLXRenderReq;
+ while (left > 0) {
+ __GLXrenderSizeData *entry;
+ int extra;
+ void (* proc)(GLbyte *);
+
+ /*
+ ** Verify that the header length and the overall length agree.
+ ** Also, each command must be word aligned.
+ */
+ hdr = (__GLXrenderHeader *) pc;
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ /*
+ ** Check for core opcodes and grab entry data.
+ */
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ entry = &__glXRenderSizeTable[opcode];
+ proc = __glXRenderTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ entry =
+ &__glXRenderSizeTable_EXT[opcode -
+ __GLX_MIN_RENDER_OPCODE_EXT];
+ proc = __glXRenderTable_EXT[opcode -
+ __GLX_MIN_RENDER_OPCODE_EXT];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = commandsDone;
+ return __glXBadRenderRequest;
+ }
+
+ if (!entry->bytes) {
+ /* unused opcode */
+ client->errorValue = commandsDone;
+ return __glXBadRenderRequest;
+ }
+ if (entry->varsize) {
+ /* variable size command */
+ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False);
+ if (extra < 0) {
+ extra = 0;
+ }
+ if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry->bytes)) {
+ return BadLength;
+ }
+ }
+ if (left < cmdlen) {
+ return BadLength;
+ }
+
+ /*
+ ** Skip over the header and execute the command. We allow the
+ ** caller to trash the command memory. This is useful especially
+ ** for things that require double alignment - they can just shift
+ ** the data towards lower memory (trashing the header) by 4 bytes
+ ** and achieve the required alignment.
+ */
+ (*proc)(pc + __GLX_RENDER_HDR_SIZE);
+ pc += cmdlen;
+ left -= cmdlen;
+ commandsDone++;
+ }
+ __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+ return Success;
+}
+
+/*
+** Execute a large rendering request (one that spans multiple X requests).
+*/
+int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderLargeReq *req;
+ ClientPtr client= cl->client;
+ GLuint dataBytes;
+ void (*proc)(GLbyte *);
+ __GLXrenderLargeHeader *hdr;
+ __GLXcontext *glxc;
+ int error;
+ CARD16 opcode;
+
+ /*
+ ** NOTE: much of this code also appears in the byteswapping version of this
+ ** routine, __glXSwapRenderLarge(). Any changes made here should also be
+ ** duplicated there.
+ */
+
+ req = (xGLXRenderLargeReq *) pc;
+ glxc = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!glxc) {
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return error;
+ }
+ dataBytes = req->dataBytes;
+
+ /*
+ ** Check the request length.
+ */
+ if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
+ client->errorValue = req->length;
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return BadLength;
+ }
+ pc += sz_xGLXRenderLargeReq;
+
+ if (cl->largeCmdRequestsSoFar == 0) {
+ __GLXrenderSizeData *entry;
+ int extra, cmdlen;
+ /*
+ ** This is the first request of a multi request command.
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (req->requestNumber != 1) {
+ client->errorValue = req->requestNumber;
+ return __glXBadLargeRequest;
+ }
+
+ hdr = (__GLXrenderLargeHeader *) pc;
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ /*
+ ** Check for core opcodes and grab entry data.
+ */
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ entry = &__glXRenderSizeTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ opcode -= __GLX_MIN_RENDER_OPCODE_EXT;
+ entry = &__glXRenderSizeTable_EXT[opcode];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+
+ if (!entry->bytes) {
+ /* unused opcode */
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+ if (entry->varsize) {
+ /*
+ ** If it's a variable-size command (a command whose length must
+ ** be computed from its parameters), all the parameters needed
+ ** will be in the 1st request, so it's okay to do this.
+ */
+ extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, False);
+ if (extra < 0) {
+ extra = 0;
+ }
+ /* large command's header is 4 bytes longer, so add 4 */
+ if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry->bytes + 4)) {
+ return BadLength;
+ }
+ }
+ /*
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (cl->largeCmdBufSize < cmdlen) {
+ if (!cl->largeCmdBuf) {
+ cl->largeCmdBuf = (GLbyte *) __glXMalloc((size_t)cmdlen);
+ } else {
+ cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf,
+ (size_t)cmdlen);
+ }
+ if (!cl->largeCmdBuf) {
+ return BadAlloc;
+ }
+ cl->largeCmdBufSize = cmdlen;
+ }
+ __glXMemcpy(cl->largeCmdBuf, pc, dataBytes);
+
+ cl->largeCmdBytesSoFar = dataBytes;
+ cl->largeCmdBytesTotal = cmdlen;
+ cl->largeCmdRequestsSoFar = 1;
+ cl->largeCmdRequestsTotal = req->requestTotal;
+ return Success;
+
+ } else {
+ /*
+ ** We are receiving subsequent (i.e. not the first) requests of a
+ ** multi request command.
+ */
+
+ /*
+ ** Check the request number and the total request count.
+ */
+ if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
+ client->errorValue = req->requestNumber;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ if (req->requestTotal != cl->largeCmdRequestsTotal) {
+ client->errorValue = req->requestTotal;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Check that we didn't get too much data.
+ */
+ if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
+ cl->largeCmdBytesSoFar += dataBytes;
+ cl->largeCmdRequestsSoFar++;
+
+ if (req->requestNumber == cl->largeCmdRequestsTotal) {
+ /*
+ ** This is the last request; it must have enough bytes to complete
+ ** the command.
+ */
+ /* NOTE: the two pad macros have been added below; they are needed
+ ** because the client library pads the total byte count, but not
+ ** the per-request byte counts. The Protocol Encoding says the
+ ** total byte count should not be padded, so a proposal will be
+ ** made to the ARB to relax the padding constraint on the total
+ ** byte count, thus preserving backward compatibility. Meanwhile,
+ ** the padding done below fixes a bug that did not allow
+ ** large commands of odd sizes to be accepted by the server.
+ */
+ if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
+ __GLX_PAD(cl->largeCmdBytesTotal)) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
+ opcode = hdr->opcode;
+
+ /*
+ ** Use the opcode to index into the procedure table.
+ */
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ proc = __glXRenderTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ opcode -= __GLX_MIN_RENDER_OPCODE_EXT;
+ proc = __glXRenderTable_EXT[opcode];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Skip over the header and execute the command.
+ */
+ (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
+ __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+
+ /*
+ ** Reset for the next RenderLarge series.
+ */
+ __glXResetLargeCommandStatus(cl);
+ } else {
+ /*
+ ** This is neither the first nor the last request.
+ */
+ }
+ return Success;
+ }
+}
+
+extern RESTYPE __glXSwapBarrierRes;
+
+static int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
+ XID drawable = req->drawable;
+ int barrier = req->barrier;
+ DrawablePtr pDraw = (DrawablePtr) LookupDrawable(drawable, client);
+ int screen = pDraw->pScreen->myNum;
+
+
+ if (pDraw && (pDraw->type == DRAWABLE_WINDOW)) {
+ if (__glXSwapBarrierFuncs &&
+ __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc) {
+ int ret = __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, barrier);
+ if (ret == Success) {
+ if (barrier)
+ /* add source for cleanup when drawable is gone */
+ AddResource(drawable, __glXSwapBarrierRes, (pointer)screen);
+ else
+ /* delete source */
+ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
+ }
+ return ret;
+ }
+ }
+ client->errorValue = drawable;
+ return __glXBadDrawable;
+}
+
+
+static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryMaxSwapBarriersSGIXReq *req =
+ (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
+ xGLXQueryMaxSwapBarriersSGIXReply reply;
+ int screen = req->screen;
+
+ if (__glXSwapBarrierFuncs &&
+ __glXSwapBarrierFuncs[screen].queryMaxSwapBarriersFunc)
+ reply.max = __glXSwapBarrierFuncs[screen].queryMaxSwapBarriersFunc(screen);
+ else
+ reply.max = 0;
+
+
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ }
+
+ WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
+ (char *) &reply);
+ return Success;
+}
+
+#define GLX_BAD_HYPERPIPE_SGIX 92
+
+static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
+ xGLXQueryHyperpipeNetworkSGIXReply reply;
+ int screen = req->screen;
+ void *rdata = NULL;
+
+ int length=0;
+ int npipes=0;
+
+ int n= 0;
+
+ if (__glXHyperpipeFuncs &&
+ __glXHyperpipeFuncs[screen].queryHyperpipeNetworkFunc != NULL) {
+ rdata =
+ (__glXHyperpipeFuncs[screen].queryHyperpipeNetworkFunc(screen, &npipes, &n));
+ }
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+ reply.npipes = npipes;
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.n);
+ __GLX_SWAP_INT(&reply.npipes);
+ }
+ WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply,
+ (char *) &reply);
+
+ WriteToClient(client, length << 2, (char *)rdata);
+
+ return Success;
+}
+
+static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyHyperpipeConfigSGIXReq * req =
+ (xGLXDestroyHyperpipeConfigSGIXReq *) pc;
+ xGLXDestroyHyperpipeConfigSGIXReply reply;
+ int screen = req->screen;
+ int success = GLX_BAD_HYPERPIPE_SGIX;
+ int hpId ;
+
+ hpId = req->hpId;
+
+
+ if (__glXHyperpipeFuncs &&
+ __glXHyperpipeFuncs[screen].destroyHyperpipeConfigFunc != NULL) {
+ success = __glXHyperpipeFuncs[screen].destroyHyperpipeConfigFunc(screen, hpId);
+ }
+
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = __GLX_PAD(0) >> 2;
+ reply.n = 0;
+ reply.success = success;
+
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ }
+ WriteToClient(client,
+ sz_xGLXDestroyHyperpipeConfigSGIXReply,
+ (char *) &reply);
+ return Success;
+}
+
+static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryHyperpipeConfigSGIXReq * req =
+ (xGLXQueryHyperpipeConfigSGIXReq *) pc;
+ xGLXQueryHyperpipeConfigSGIXReply reply;
+ int screen = req->screen;
+ void *rdata = NULL;
+ int length;
+ int npipes=0;
+ int n= 0;
+ int hpId;
+
+ hpId = req->hpId;
+
+ if (__glXHyperpipeFuncs &&
+ __glXHyperpipeFuncs[screen].queryHyperpipeConfigFunc != NULL) {
+ rdata = __glXHyperpipeFuncs[screen].queryHyperpipeConfigFunc(screen, hpId,&npipes, &n);
+ }
+
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+ reply.npipes = npipes;
+
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.n);
+ __GLX_SWAP_INT(&reply.npipes);
+ }
+
+ WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply,
+ (char *) &reply);
+
+ WriteToClient(client, length << 2, (char *)rdata);
+
+ return Success;
+}
+
+static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXHyperpipeConfigSGIXReq * req =
+ (xGLXHyperpipeConfigSGIXReq *) pc;
+ xGLXHyperpipeConfigSGIXReply reply;
+ int screen = req->screen;
+ void *rdata;
+
+ int npipes=0, networkId;
+ int hpId=-1;
+
+ networkId = (int)req->networkId;
+ npipes = (int)req->npipes;
+ rdata = (void *)(req +1);
+
+ if (__glXHyperpipeFuncs &&
+ __glXHyperpipeFuncs[screen].hyperpipeConfigFunc != NULL) {
+ __glXHyperpipeFuncs[screen].hyperpipeConfigFunc(screen,networkId,
+ &hpId, &npipes,
+ (void *) rdata);
+ }
+
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = __GLX_PAD(0) >> 2;
+ reply.n = 0;
+ reply.npipes = npipes;
+ reply.hpId = hpId;
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.npipes);
+ __GLX_SWAP_INT(&reply.hpId);
+ }
+
+ WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply,
+ (char *) &reply);
+
+ return Success;
+}
+
+
+/************************************************************************/
+
+/*
+** No support is provided for the vendor-private requests other than
+** allocating the entry points in the dispatch table.
+*/
+
+int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req;
+ GLint vendorcode;
+
+ req = (xGLXVendorPrivateReq *) pc;
+ vendorcode = req->vendorCode;
+
+#ifndef __DARWIN__
+ switch( vendorcode ) {
+ case X_GLvop_SampleMaskSGIS:
+ glSampleMaskSGIS(*(GLfloat *)(pc + 4),
+ *(GLboolean *)(pc + 8));
+ return Success;
+ case X_GLvop_SamplePatternSGIS:
+ glSamplePatternSGIS( *(GLenum *)(pc + 4));
+ return Success;
+ case X_GLXvop_BindSwapBarrierSGIX:
+ return __glXBindSwapBarrierSGIX(cl, pc);
+ }
+#endif
+
+ if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
+ (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
+ (*__glXVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])
+ (cl, (GLbyte*)req);
+ return Success;
+ }
+ /*
+ ** This sample implemention does not support any private requests.
+ */
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
+}
+
+int __glXVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateWithReplyReq *req;
+ GLint vendorcode;
+
+ req = (xGLXVendorPrivateWithReplyReq *) pc;
+ vendorcode = req->vendorCode;
+
+ switch (vendorcode) {
+ case X_GLXvop_QueryContextInfoEXT:
+ return __glXQueryContextInfoEXT(cl, pc);
+ case X_GLXvop_MakeCurrentReadSGI:
+ return __glXMakeCurrentReadSGI(cl, pc);
+ case X_GLXvop_QueryMaxSwapBarriersSGIX:
+ return __glXQueryMaxSwapBarriersSGIX(cl, pc);
+ case X_GLXvop_QueryHyperpipeNetworkSGIX:
+ return __glxQueryHyperpipeNetworkSGIX(cl, pc);
+ case X_GLXvop_QueryHyperpipeConfigSGIX:
+ return __glxQueryHyperpipeConfigSGIX(cl, pc);
+ case X_GLXvop_DestroyHyperpipeConfigSGIX:
+ return __glxDestroyHyperpipeConfigSGIX(cl, pc);
+ case X_GLXvop_HyperpipeConfigSGIX:
+ return __glxHyperpipeConfigSGIX(cl, pc);
+ case X_GLXvop_GetFBConfigsSGIX:
+ return __glXGetFBConfigsSGIX(cl, pc);
+ case X_GLXvop_CreateContextWithConfigSGIX:
+ return __glXCreateContextWithConfigSGIX(cl, pc);
+ case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
+ return __glXCreateGLXPixmapWithConfigSGIX(cl, pc);
+ default:
+ break;
+ }
+
+ if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
+ (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
+ return
+ (*__glXVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])
+ (cl, (GLbyte*)req);
+ }
+
+ cl->client->errorValue = vendorcode;
+ return __glXUnsupportedPrivateRequest;
+}
+
+int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
+ xGLXQueryExtensionsStringReply reply;
+ GLuint screen;
+ size_t n, length;
+ const char *ptr;
+ char *buf;
+
+ screen = req->screen;
+ /*
+ ** Check if screen exists.
+ */
+ if (screen >= screenInfo.numScreens) {
+ client->errorValue = screen;
+ return BadValue;
+ }
+
+ ptr = __glXActiveScreens[screen].GLXextensions;
+
+ n = __glXStrlen(ptr) + 1;
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+
+ if ((buf = (char *) __glXMalloc(length << 2)) == NULL) {
+ return BadAlloc;
+ }
+ __glXStrncpy(buf, ptr, n);
+
+ if (client->swapped) {
+ glxSwapQueryExtensionsStringReply(client, &reply, buf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply);
+ WriteToClient(client, (int)(length << 2), (char *)buf);
+ }
+
+ __glXFree(buf);
+ return Success;
+}
+
+int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
+ xGLXQueryServerStringReply reply;
+ int name;
+ GLuint screen;
+ size_t n, length;
+ const char *ptr;
+ char *buf;
+
+ name = req->name;
+ screen = req->screen;
+ /*
+ ** Check if screen exists.
+ */
+ if (screen >= screenInfo.numScreens) {
+ client->errorValue = screen;
+ return BadValue;
+ }
+ switch(name) {
+ case GLX_VENDOR:
+ ptr = __glXActiveScreens[screen].GLXvendor;
+ break;
+ case GLX_VERSION:
+ ptr = __glXActiveScreens[screen].GLXversion;
+ break;
+ case GLX_EXTENSIONS:
+ ptr = __glXActiveScreens[screen].GLXextensions;
+ break;
+ default:
+ return BadValue;
+ }
+
+ n = __glXStrlen(ptr) + 1;
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+
+ if ((buf = (char *) Xalloc(length << 2)) == NULL) {
+ return BadAlloc;
+ }
+ __glXStrncpy(buf, ptr, n);
+
+ if (client->swapped) {
+ glxSwapQueryServerStringReply(client, &reply, buf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply);
+ WriteToClient(client, (int)(length << 2), buf);
+ }
+
+ __glXFree(buf);
+ return Success;
+}
+
+int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
+ const char *buf;
+
+ cl->GLClientmajorVersion = req->major;
+ cl->GLClientminorVersion = req->minor;
+ if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
+ buf = (const char *)(req+1);
+ cl->GLClientextensions = __glXStrdup(buf);
+
+ return Success;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c
new file mode 100644
index 000000000..595e814e5
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c
@@ -0,0 +1,871 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.10 2004/01/28 18:11:50 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#define FONT_PCF
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include <GL/glxtokens.h>
+#include <unpack.h>
+#include <g_disptab.h>
+#include <g_disptab_EXT.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include "glxext.h"
+#include "GL/glx_ansic.h"
+
+static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+static int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
+
+/************************************************************************/
+
+/*
+** Byteswapping versions of GLX commands. In most cases they just swap
+** the incoming arguments and then call the unswapped routine. For commands
+** that have replies, a separate swapping routine for the reply is provided;
+** it is called at the end of the unswapped routine.
+*/
+
+int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->visual);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return DoCreateContext( cl, req->context, req->shareList, req->visual,
+ req->screen, req->isDirect );
+}
+
+int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->renderType);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
+ req->screen, req->isDirect );
+}
+
+int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->renderType);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
+ req->screen, req->isDirect );
+}
+
+int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXDestroyContext(cl, pc);
+}
+
+int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return DoMakeCurrent( cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readdrawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return DoMakeCurrent( cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return DoMakeCurrent( cl, req->drawable, req->readable,
+ req->context, req->oldContextTag );
+}
+
+int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXIsDirect(cl, pc);
+}
+
+int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->majorVersion);
+ __GLX_SWAP_INT(&req->minorVersion);
+
+ return __glXQueryVersion(cl, pc);
+}
+
+int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ return __glXWaitGL(cl, pc);
+}
+
+int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ return __glXWaitX(cl, pc);
+}
+
+int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->source);
+ __GLX_SWAP_INT(&req->dest);
+ __GLX_SWAP_INT(&req->mask);
+
+ return __glXCopyContext(cl, pc);
+}
+
+int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->screen);
+ return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
+}
+
+int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->screen);
+ return DoGetFBConfigs( cl, req->screen, GL_TRUE );
+}
+
+int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->screen);
+ return DoGetFBConfigs( cl, req->screen, GL_TRUE );
+}
+
+int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->visual);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return DoCreateGLXPixmap( cl, req->visual, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateGLXPixmapWithConfigSGIXReq *req =
+ (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
+ req->pixmap, req->glxpixmap );
+}
+
+int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDestroyGLXPixmap(cl, pc);
+}
+
+int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->drawable);
+
+ return __glXSwapBuffers(cl, pc);
+}
+
+int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->font);
+ __GLX_SWAP_INT(&req->first);
+ __GLX_SWAP_INT(&req->count);
+ __GLX_SWAP_INT(&req->listBase);
+
+ return __glXUseXFont(cl, pc);
+}
+
+
+int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryExtensionsStringReq *req = NULL;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+
+ return __glXQueryExtensionsString(cl, pc);
+}
+
+int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->name);
+
+ return __glXQueryServerString(cl, pc);
+}
+
+int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->major);
+ __GLX_SWAP_INT(&req->minor);
+ __GLX_SWAP_INT(&req->numbytes);
+
+ return __glXClientInfo(cl, pc);
+}
+
+int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXQueryContextInfoEXT(cl, pc);
+}
+
+/************************************************************************/
+
+/*
+** Swap replies.
+*/
+
+void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->contextTag);
+ WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
+}
+
+void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
+}
+
+void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->majorVersion);
+ __GLX_SWAP_INT(&reply->minorVersion);
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
+}
+
+void glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply *reply, char *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
+ __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, length << 2, buf);
+}
+
+void glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply *reply, char *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
+ /** no swap is needed for an array of chars **/
+ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
+ WriteToClient(client, length << 2, buf);
+}
+
+void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
+ __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, length << 2, (char *)buf);
+}
+
+
+/************************************************************************/
+
+/*
+** Render and Renderlarge are not in the GLX API. They are used by the GLX
+** client library to send batches of GL rendering commands.
+*/
+
+int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderReq *req;
+ ClientPtr client= cl->client;
+ int left, cmdlen, error;
+ int commandsDone;
+ CARD16 opcode;
+ __GLXrenderHeader *hdr;
+ __GLXcontext *cx;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ /*
+ ** NOTE: much of this code also appears in the nonswapping version of this
+ ** routine, __glXRender(). Any changes made here should also be
+ ** duplicated there.
+ */
+
+ req = (xGLXRenderReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ cx = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!cx) {
+ return error;
+ }
+
+ commandsDone = 0;
+ pc += sz_xGLXRenderReq;
+ left = (req->length << 2) - sz_xGLXRenderReq;
+ while (left > 0) {
+ __GLXrenderSizeData *entry;
+ int extra;
+ void (* proc)(GLbyte *);
+
+ /*
+ ** Verify that the header length and the overall length agree.
+ ** Also, each command must be word aligned.
+ */
+ hdr = (__GLXrenderHeader *) pc;
+ __GLX_SWAP_SHORT(&hdr->length);
+ __GLX_SWAP_SHORT(&hdr->opcode);
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ entry = &__glXRenderSizeTable[opcode];
+ proc = __glXSwapRenderTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
+ entry = &__glXRenderSizeTable_EXT[index];
+ proc = __glXSwapRenderTable_EXT[index];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = commandsDone;
+ return __glXBadRenderRequest;
+ }
+ if (!entry->bytes) {
+ /* unused opcode */
+ client->errorValue = commandsDone;
+ return __glXBadRenderRequest;
+ }
+ if (entry->varsize) {
+ /* variable size command */
+ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True);
+ if (extra < 0) {
+ extra = 0;
+ }
+ if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry->bytes)) {
+ return BadLength;
+ }
+ }
+ if (left < cmdlen) {
+ return BadLength;
+ }
+
+ /*
+ ** Skip over the header and execute the command. We allow the
+ ** caller to trash the command memory. This is useful especially
+ ** for things that require double alignment - they can just shift
+ ** the data towards lower memory (trashing the header) by 4 bytes
+ ** and achieve the required alignment.
+ */
+ (*proc)(pc + __GLX_RENDER_HDR_SIZE);
+ pc += cmdlen;
+ left -= cmdlen;
+ commandsDone++;
+ }
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+/*
+** Execute a large rendering request (one that spans multiple X requests).
+*/
+int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderLargeReq *req;
+ ClientPtr client= cl->client;
+ size_t dataBytes;
+ void (*proc)(GLbyte *);
+ __GLXrenderLargeHeader *hdr;
+ __GLXcontext *cx;
+ int error;
+ CARD16 opcode;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ /*
+ ** NOTE: much of this code also appears in the nonswapping version of this
+ ** routine, __glXRenderLarge(). Any changes made here should also be
+ ** duplicated there.
+ */
+
+ req = (xGLXRenderLargeReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->dataBytes);
+ __GLX_SWAP_SHORT(&req->requestNumber);
+ __GLX_SWAP_SHORT(&req->requestTotal);
+ cx = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!cx) {
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return error;
+ }
+ dataBytes = req->dataBytes;
+
+ /*
+ ** Check the request length.
+ */
+ if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
+ client->errorValue = req->length;
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return BadLength;
+ }
+ pc += sz_xGLXRenderLargeReq;
+
+ if (cl->largeCmdRequestsSoFar == 0) {
+ __GLXrenderSizeData *entry;
+ int extra;
+ size_t cmdlen;
+ /*
+ ** This is the first request of a multi request command.
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (req->requestNumber != 1) {
+ client->errorValue = req->requestNumber;
+ return __glXBadLargeRequest;
+ }
+ hdr = (__GLXrenderLargeHeader *) pc;
+ __GLX_SWAP_INT(&hdr->length);
+ __GLX_SWAP_INT(&hdr->opcode);
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ entry = &__glXRenderSizeTable[opcode];
+ proc = __glXSwapRenderTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
+ entry = &__glXRenderSizeTable_EXT[index];
+ proc = __glXSwapRenderTable_EXT[index];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+
+ if (!entry->bytes) {
+ /* unused opcode */
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+ if (entry->varsize) {
+ /*
+ ** If it's a variable-size command (a command whose length must
+ ** be computed from its parameters), all the parameters needed
+ ** will be in the 1st request, so it's okay to do this.
+ */
+ extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True);
+ if (extra < 0) {
+ extra = 0;
+ }
+ /* large command's header is 4 bytes longer, so add 4 */
+ if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry->bytes + 4)) {
+ return BadLength;
+ }
+ }
+ /*
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (cl->largeCmdBufSize < cmdlen) {
+ if (!cl->largeCmdBuf) {
+ cl->largeCmdBuf = (GLbyte *) __glXMalloc(cmdlen);
+ } else {
+ cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, cmdlen);
+ }
+ if (!cl->largeCmdBuf) {
+ return BadAlloc;
+ }
+ cl->largeCmdBufSize = cmdlen;
+ }
+ __glXMemcpy(cl->largeCmdBuf, pc, dataBytes);
+
+ cl->largeCmdBytesSoFar = dataBytes;
+ cl->largeCmdBytesTotal = cmdlen;
+ cl->largeCmdRequestsSoFar = 1;
+ cl->largeCmdRequestsTotal = req->requestTotal;
+ return Success;
+
+ } else {
+ /*
+ ** We are receiving subsequent (i.e. not the first) requests of a
+ ** multi request command.
+ */
+
+ /*
+ ** Check the request number and the total request count.
+ */
+ if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
+ client->errorValue = req->requestNumber;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ if (req->requestTotal != cl->largeCmdRequestsTotal) {
+ client->errorValue = req->requestTotal;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Check that we didn't get too much data.
+ */
+ if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
+ cl->largeCmdBytesSoFar += dataBytes;
+ cl->largeCmdRequestsSoFar++;
+
+ if (req->requestNumber == cl->largeCmdRequestsTotal) {
+ /*
+ ** This is the last request; it must have enough bytes to complete
+ ** the command.
+ */
+ /* NOTE: the two pad macros have been added below; they are needed
+ ** because the client library pads the total byte count, but not
+ ** the per-request byte counts. The Protocol Encoding says the
+ ** total byte count should not be padded, so a proposal will be
+ ** made to the ARB to relax the padding constraint on the total
+ ** byte count, thus preserving backward compatibility. Meanwhile,
+ ** the padding done below fixes a bug that did not allow
+ ** large commands of odd sizes to be accepted by the server.
+ */
+ if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
+ __GLX_PAD(cl->largeCmdBytesTotal)) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXBadLargeRequest;
+ }
+ hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
+ /*
+ ** The opcode and length field in the header had already been
+ ** swapped when the first request was received.
+ */
+
+ /*
+ ** Use the opcode to index into the procedure table.
+ */
+ opcode = hdr->opcode;
+ if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
+ proc = __glXSwapRenderTable[opcode];
+#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
+ } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
+ int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
+ proc = __glXSwapRenderTable_EXT[index];
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ } else {
+ client->errorValue = opcode;
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Skip over the header and execute the command.
+ */
+ (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+
+ /*
+ ** Reset for the next RenderLarge series.
+ */
+ __glXResetLargeCommandStatus(cl);
+ } else {
+ /*
+ ** This is neither the first nor the last request.
+ */
+ }
+ return Success;
+ }
+}
+
+/************************************************************************/
+
+/*
+** No support is provided for the vendor-private requests other than
+** allocating these entry points in the dispatch table.
+*/
+
+int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req;
+ GLint vendorcode;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ req = (xGLXVendorPrivateReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+
+ vendorcode = req->vendorCode;
+
+#ifndef __DARWIN__
+ switch( vendorcode ) {
+ case X_GLvop_SampleMaskSGIS:
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ glSampleMaskSGIS(*(GLfloat *)(pc + 4),
+ *(GLboolean *)(pc + 8));
+ return Success;
+ case X_GLvop_SamplePatternSGIS:
+ __GLX_SWAP_INT(pc + 4);
+ glSamplePatternSGIS( *(GLenum *)(pc + 4));
+ return Success;
+ }
+#endif
+
+
+ if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
+ (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
+ (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
+ return Success;
+ }
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
+}
+
+int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateWithReplyReq *req;
+ GLint vendorcode;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ req = (xGLXVendorPrivateWithReplyReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+
+ vendorcode = req->vendorCode;
+
+ switch (vendorcode) {
+ case X_GLXvop_QueryContextInfoEXT:
+ return __glXSwapQueryContextInfoEXT(cl, pc);
+ case X_GLXvop_MakeCurrentReadSGI:
+ return __glXSwapMakeCurrentReadSGI(cl, pc);
+ case X_GLXvop_GetFBConfigsSGIX:
+ return __glXSwapGetFBConfigsSGIX(cl, pc);
+ case X_GLXvop_CreateContextWithConfigSGIX:
+ return __glXSwapCreateContextWithConfigSGIX(cl, pc);
+ case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
+ return __glXSwapCreateGLXPixmapWithConfigSGIX(cl, pc);
+ default:
+ break;
+ }
+
+
+ if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
+ (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
+ return (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
+ }
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxcontext.h b/nx-X11/programs/Xserver/GL/glx/glxcontext.h
new file mode 100644
index 000000000..18d8b44c2
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxcontext.h
@@ -0,0 +1,164 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxcontext.h,v 1.4 2002/02/22 21:45:07 dawes Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_context_h_
+#define _GLX_context_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+typedef struct __GLXcontextRec __GLXcontext;
+
+/* XXX: should be defined somewhere globally */
+#define CAPI
+
+#include "GL/internal/glcore.h"
+
+struct __GLXcontextRec {
+ /*
+ ** list of context structs
+ */
+ struct __GLXcontextRec *last;
+ struct __GLXcontextRec *next;
+
+ /*
+ ** list of contexts bound to the same drawable
+ */
+ struct __GLXcontextRec *nextDrawPriv;
+ struct __GLXcontextRec *nextReadPriv;
+
+ /*
+ ** Opaque pointer the context object created by the GL that the
+ ** server is bound with. Never dereferenced by this code, but used
+ ** as a handle to feed to the routines in the screen info struct.
+ */
+ __GLinterface *gc;
+
+ /*
+ ** mode struct for this context
+ */
+ __GLcontextModes *modes;
+
+ /*
+ ** Pointer to screen info data for this context. This is set
+ ** when the context is created.
+ */
+ ScreenPtr pScreen;
+ __GLXscreenInfo *pGlxScreen;
+
+ /*
+ ** This context is created with respect to this visual.
+ */
+ VisualRec *pVisual;
+
+ /*
+ ** The XID of this context.
+ */
+ XID id;
+
+ /*
+ ** The XID of the shareList context.
+ */
+ XID share_id;
+
+ /*
+ ** Visual id.
+ */
+ VisualID vid;
+
+ /*
+ ** screen number.
+ */
+ GLint screen;
+
+ /*
+ ** Whether this context's ID still exists.
+ */
+ GLboolean idExists;
+
+ /*
+ ** Whether this context is current for some client.
+ */
+ GLboolean isCurrent;
+
+ /*
+ ** Whether this context is a direct rendering context.
+ */
+ GLboolean isDirect;
+
+ /*
+ ** Window pending state
+ */
+ GLuint pendingState;
+
+ /*
+ ** This flag keeps track of whether there are unflushed GL commands.
+ */
+ GLboolean hasUnflushedCommands;
+
+ /*
+ ** Current rendering mode for this context.
+ */
+ GLenum renderMode;
+
+ /*
+ ** Buffers for feedback and selection.
+ */
+ GLfloat *feedbackBuf;
+ GLint feedbackBufSize; /* number of elements allocated */
+ GLuint *selectBuf;
+ GLint selectBufSize; /* number of elements allocated */
+
+ /*
+ ** Set only if current drawable is a glx pixmap.
+ */
+ __GLXpixmap *drawPixmap;
+ __GLXpixmap *readPixmap;
+
+ /*
+ ** The drawable private this context is bound to
+ */
+ __GLXdrawablePrivate *drawPriv;
+ __GLXdrawablePrivate *readPriv;
+};
+
+/* pending state defines */
+#define __GLX_PENDING_RESIZE 0x1
+#define __GLX_PENDING_DESTROY 0x2
+#define __GLX_PENDING_SWAP 0x4
+
+#endif /* !__GLX_context_h__ */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxdrawable.h b/nx-X11/programs/Xserver/GL/glx/glxdrawable.h
new file mode 100644
index 000000000..38a05bfeb
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxdrawable.h
@@ -0,0 +1,112 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxdrawable.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_drawable_h_
+#define _GLX_drawable_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+typedef struct {
+
+ DrawablePtr pDraw;
+ __GLcontextModes *modes;
+ __GLXscreenInfo *pGlxScreen;
+ ScreenPtr pScreen;
+ Bool idExists;
+ int refcnt;
+
+} __GLXpixmap;
+
+struct __GLXdrawablePrivateRec {
+ /*
+ ** list of drawable private structs
+ */
+ struct __GLXdrawablePrivateRec *last;
+ struct __GLXdrawablePrivateRec *next;
+
+ DrawablePtr pDraw;
+ XID drawId;
+ __GLXpixmap *pGlxPixmap;
+
+ /*
+ ** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
+ ** Needed by the resource freer because pDraw might already have been
+ ** freed.
+ */
+ int type;
+
+ /*
+ ** Configuration of the visual to which this drawable was created.
+ */
+ __GLcontextModes *modes;
+
+ /*
+ ** cached drawable size and origin
+ */
+
+ GLint xorigin, yorigin;
+ GLint width, height;
+
+ /*
+ ** Lists of contexts bound to this drawable. There are two lists here.
+ ** One list is of the contexts that have this drawable bound for drawing,
+ ** and the other is the list of contexts that have this drawable bound
+ ** for reading.
+ */
+ struct __GLXcontextRec *drawGlxc;
+ struct __GLXcontextRec *readGlxc;
+
+ /*
+ ** "methods" that the drawble should be able to respond to.
+ */
+ void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
+ void (*updatePalette)(struct __GLXdrawablePrivateRec *);
+ GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
+
+ /*
+ ** The GL drawable (information shared between GLX and the GL core)
+ */
+ __GLdrawablePrivate glPriv;
+
+ /*
+ ** reference count
+ */
+ int refCount;
+};
+
+#endif /* !__GLX_drawable_h__ */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxerror.h b/nx-X11/programs/Xserver/GL/glx/glxerror.h
new file mode 100644
index 000000000..2c6d6d863
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxerror.h
@@ -0,0 +1,58 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_error_h_
+#define _GLX_error_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+** Error codes. These have the extension error base added to them
+** when the extension initializes.
+*/
+extern int __glXBadContext;
+extern int __glXBadContextState;
+extern int __glXBadDrawable;
+extern int __glXBadPixmap;
+extern int __glXBadCurrentWindow;
+extern int __glXBadContextTag;
+extern int __glXBadRenderRequest;
+extern int __glXBadLargeRequest;
+extern int __glXUnsupportedPrivateRequest;
+
+#endif
diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c
new file mode 100644
index 000000000..fa1382983
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxext.c
@@ -0,0 +1,505 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $
+** The contents of this file are subject to the GLX Public License Version 1.0
+** (the "License"). You may not use this file except in compliance with the
+** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
+** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
+** or at http://www.sgi.com/software/opensource/glx/license.html.
+**
+** Software distributed under the License is distributed on an "AS IS"
+** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
+** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
+** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
+** language governing rights and limitations under the License.
+**
+** The Original Software is GLX version 1.2 source code, released February,
+** 1999. The developer of the Original Software is Silicon Graphics, Inc.
+** Those portions of the Subject Software created by Silicon Graphics, Inc.
+** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include <windowstr.h>
+#include <propertyst.h>
+#include <os.h>
+#include "g_disptab.h"
+#include "unpack.h"
+#include "glxutil.h"
+#include "glxext.h"
+#include "micmap.h"
+
+
+void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+void GlxSetVisualConfigs(int nconfigs,
+ __GLXvisualConfig *configs, void **privates);
+
+static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */;
+
+/*
+** Forward declarations.
+*/
+static int __glXSwapDispatch(ClientPtr);
+static int __glXDispatch(ClientPtr);
+
+/*
+** Called when the extension is reset.
+*/
+static void ResetExtension(ExtensionEntry* extEntry)
+{
+ __glXFlushContextCache();
+ (*__glXExt->resetExtension)();
+ __glXScreenReset();
+}
+
+/*
+** Initialize the per-client context storage.
+*/
+static void ResetClientState(int clientIndex)
+{
+ __GLXclientState *cl = __glXClients[clientIndex];
+
+ if (cl->returnBuf) __glXFree(cl->returnBuf);
+ if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf);
+ if (cl->currentContexts) __glXFree(cl->currentContexts);
+ __glXMemset(cl, 0, sizeof(__GLXclientState));
+ /*
+ ** By default, assume that the client supports
+ ** GLX major version 1 minor version 0 protocol.
+ */
+ cl->GLClientmajorVersion = 1;
+ cl->GLClientminorVersion = 0;
+ if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
+
+}
+
+/*
+** Reset state used to keep track of large (multi-request) commands.
+*/
+void __glXResetLargeCommandStatus(__GLXclientState *cl)
+{
+ cl->largeCmdBytesSoFar = 0;
+ cl->largeCmdBytesTotal = 0;
+ cl->largeCmdRequestsSoFar = 0;
+ cl->largeCmdRequestsTotal = 0;
+}
+
+/*
+** This procedure is called when the client who created the context goes
+** away OR when glXDestroyContext is called. In either case, all we do is
+** flag that the ID is no longer valid, and (maybe) free the context.
+** use.
+*/
+static int ContextGone(__GLXcontext* cx, XID id)
+{
+ cx->idExists = GL_FALSE;
+ if (!cx->isCurrent) {
+ __glXFreeContext(cx);
+ }
+
+ return True;
+}
+
+/*
+** Free a client's state.
+*/
+static int ClientGone(int clientIndex, XID id)
+{
+ __GLXcontext *cx;
+ __GLXclientState *cl = __glXClients[clientIndex];
+ int i;
+
+ if (cl) {
+ /*
+ ** Free all the contexts that are current for this client.
+ */
+ for (i=0; i < cl->numCurrentContexts; i++) {
+ cx = cl->currentContexts[i];
+ if (cx) {
+ __glXDeassociateContext(cx);
+ cx->isCurrent = GL_FALSE;
+ if (!cx->idExists) {
+ __glXFreeContext(cx);
+ }
+ }
+ }
+ /*
+ ** Re-initialize the client state structure. Don't free it because
+ ** we'll probably get another client with this index and use the struct
+ ** again. There is a maximum of MAXCLIENTS of these structures.
+ */
+ ResetClientState(clientIndex);
+ }
+
+ return True;
+}
+
+/*
+** Free a GLX Pixmap.
+*/
+static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
+{
+ PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
+
+ pGlxPixmap->idExists = False;
+ if (!pGlxPixmap->refcnt) {
+ /*
+ ** The DestroyPixmap routine should decrement the refcount and free
+ ** only if it's zero.
+ */
+ (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
+ __glXFree(pGlxPixmap);
+ }
+
+ return True;
+}
+
+/*
+** Free a context.
+*/
+GLboolean __glXFreeContext(__GLXcontext *cx)
+{
+ if (cx->idExists || cx->isCurrent) return GL_FALSE;
+
+ if (!cx->isDirect) {
+ if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
+ return GL_FALSE;
+ }
+ }
+ if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
+ if (cx->selectBuf) __glXFree(cx->selectBuf);
+ __glXFree(cx);
+ if (cx == __glXLastContext) {
+ __glXFlushContextCache();
+ }
+
+ return GL_TRUE;
+}
+
+extern RESTYPE __glXSwapBarrierRes;
+
+static int SwapBarrierGone(int screen, XID drawable)
+{
+ if (__glXSwapBarrierFuncs &&
+ __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) {
+ __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0);
+ }
+ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
+ return True;
+}
+
+/************************************************************************/
+
+/*
+** These routines can be used to check whether a particular GL command
+** has caused an error. Specifically, we use them to check whether a
+** given query has caused an error, in which case a zero-length data
+** reply is sent to the client.
+*/
+
+static GLboolean errorOccured = GL_FALSE;
+
+/*
+** The GL was will call this routine if an error occurs.
+*/
+void __glXErrorCallBack(__GLinterface *gc, GLenum code)
+{
+ errorOccured = GL_TRUE;
+}
+
+/*
+** Clear the error flag before calling the GL command.
+*/
+void __glXClearErrorOccured(void)
+{
+ errorOccured = GL_FALSE;
+}
+
+/*
+** Check if the GL command caused an error.
+*/
+GLboolean __glXErrorOccured(void)
+{
+ return errorOccured;
+}
+
+/************************************************************************/
+
+/*
+** Initialize the GLX extension.
+*/
+void GlxExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+ int i;
+
+ __glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
+ __glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
+ __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
+
+ /*
+ ** Add extension to server extensions.
+ */
+ extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
+ __GLX_NUMBER_ERRORS, __glXDispatch,
+ __glXSwapDispatch, ResetExtension,
+ StandardMinorOpcode);
+ if (!extEntry) {
+ FatalError("__glXExtensionInit: AddExtensions failed\n");
+ return;
+ }
+ if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
+ ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
+ return;
+ }
+
+ __glXBadContext = extEntry->errorBase + GLXBadContext;
+ __glXBadContextState = extEntry->errorBase + GLXBadContextState;
+ __glXBadDrawable = extEntry->errorBase + GLXBadDrawable;
+ __glXBadPixmap = extEntry->errorBase + GLXBadPixmap;
+ __glXBadContextTag = extEntry->errorBase + GLXBadContextTag;
+ __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow;
+ __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
+ __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
+ __glXUnsupportedPrivateRequest = extEntry->errorBase +
+ GLXUnsupportedPrivateRequest;
+
+ __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
+
+ /*
+ ** Initialize table of client state. There is never a client 0.
+ */
+ for (i=1; i <= MAXCLIENTS; i++) {
+ __glXClients[i] = 0;
+ }
+
+ /*
+ ** Initialize screen specific data.
+ */
+ __glXScreenInit(screenInfo.numScreens);
+}
+
+/************************************************************************/
+
+Bool __glXCoreType(void)
+{
+ return __glXExt->type;
+}
+
+/************************************************************************/
+
+void GlxSetVisualConfigs(int nconfigs,
+ __GLXvisualConfig *configs, void **privates)
+{
+ (*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
+}
+
+static miInitVisualsProcPtr saveInitVisualsProc;
+
+Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB,
+ int preferredVis)
+{
+ Bool ret;
+
+ if (saveInitVisualsProc) {
+ ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
+ rootDepthp, defaultVisp, sizes, bitsPerRGB,
+ preferredVis);
+ if (!ret)
+ return False;
+ }
+ (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
+ defaultVisp, sizes, bitsPerRGB);
+ return True;
+}
+
+void
+GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
+{
+ saveInitVisualsProc = *initVisProc;
+ *initVisProc = GlxInitVisuals;
+ /* HACK: this shouldn't be done here but it's the earliest time */
+ __glXExt = __glXglDDXExtensionInfo(); /* from GLcore */
+}
+
+/************************************************************************/
+
+void __glXFlushContextCache(void)
+{
+ __glXLastContext = 0;
+}
+
+/*
+** Make a context the current one for the GL (in this implementation, there
+** is only one instance of the GL, and we use it to serve all GL clients by
+** switching it between different contexts). While we are at it, look up
+** a context by its tag and return its (__GLXcontext *).
+*/
+__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
+ int *error)
+{
+ __GLXcontext *cx;
+
+ /*
+ ** See if the context tag is legal; it is managed by the extension,
+ ** so if it's invalid, we have an implementation error.
+ */
+ cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag);
+ if (!cx) {
+ cl->client->errorValue = tag;
+ *error = __glXBadContextTag;
+ return 0;
+ }
+
+ if (!cx->isDirect) {
+ if (cx->drawPriv == NULL) {
+ /*
+ ** The drawable has vanished. It must be a window, because only
+ ** windows can be destroyed from under us; GLX pixmaps are
+ ** refcounted and don't go away until no one is using them.
+ */
+ *error = __glXBadCurrentWindow;
+ return 0;
+ }
+ }
+
+ if (cx == __glXLastContext) {
+ /* No need to re-bind */
+ return cx;
+ }
+
+ /* Make this context the current one for the GL. */
+ if (!cx->isDirect) {
+ if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
+ /* Bind failed, and set the error code. Bummer */
+ cl->client->errorValue = cx->id;
+ *error = __glXBadContextState;
+ return 0;
+ }
+ }
+ __glXLastContext = cx;
+ return cx;
+}
+
+/************************************************************************/
+
+/*
+** Top level dispatcher; all commands are executed from here down.
+*/
+static int __glXDispatch(ClientPtr client)
+{
+ REQUEST(xGLXSingleReq);
+ CARD8 opcode;
+ int (*proc)(__GLXclientState *cl, GLbyte *pc);
+ __GLXclientState *cl;
+
+ opcode = stuff->glxCode;
+ cl = __glXClients[client->index];
+ if (!cl) {
+ cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
+ __glXClients[client->index] = cl;
+ if (!cl) {
+ return BadAlloc;
+ }
+ __glXMemset(cl, 0, sizeof(__GLXclientState));
+ }
+
+ if (!cl->inUse) {
+ /*
+ ** This is first request from this client. Associate a resource
+ ** with the client so we will be notified when the client dies.
+ */
+ XID xid = FakeClientID(client->index);
+ if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
+ return BadAlloc;
+ }
+ ResetClientState(client->index);
+ cl->inUse = GL_TRUE;
+ cl->client = client;
+ }
+
+ /*
+ ** Check for valid opcode.
+ */
+ if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
+ return BadRequest;
+ }
+
+ /*
+ ** If we're expecting a glXRenderLarge request, this better be one.
+ */
+ if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
+ client->errorValue = stuff->glxCode;
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Use the opcode to index into the procedure table.
+ */
+ proc = __glXSingleTable[opcode];
+ return (*proc)(cl, (GLbyte *) stuff);
+}
+
+static int __glXSwapDispatch(ClientPtr client)
+{
+ REQUEST(xGLXSingleReq);
+ CARD8 opcode;
+ int (*proc)(__GLXclientState *cl, GLbyte *pc);
+ __GLXclientState *cl;
+
+ opcode = stuff->glxCode;
+ cl = __glXClients[client->index];
+ if (!cl) {
+ cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
+ __glXClients[client->index] = cl;
+ if (!cl) {
+ return BadAlloc;
+ }
+ __glXMemset(cl, 0, sizeof(__GLXclientState));
+ }
+
+ if (!cl->inUse) {
+ /*
+ ** This is first request from this client. Associate a resource
+ ** with the client so we will be notified when the client dies.
+ */
+ XID xid = FakeClientID(client->index);
+ if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
+ return BadAlloc;
+ }
+ ResetClientState(client->index);
+ cl->inUse = GL_TRUE;
+ cl->client = client;
+ }
+
+ /*
+ ** Check for valid opcode.
+ */
+ if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
+ return BadRequest;
+ }
+
+ /*
+ ** Use the opcode to index into the procedure table.
+ */
+ proc = __glXSwapSingleTable[opcode];
+ return (*proc)(cl, (GLbyte *) stuff);
+}
+
+int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
+{
+ return BadRequest;
+}
+
+void __glXNoSuchRenderOpcode(GLbyte *pc)
+{
+ return;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.h b/nx-X11/programs/Xserver/GL/glx/glxext.h
new file mode 100644
index 000000000..5d569899f
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxext.h
@@ -0,0 +1,131 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.7 2003/11/17 22:20:26 dawes Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxext_h_
+#define _glxext_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+ * Added by VA Linux for XFree86 4.0.x
+ */
+typedef struct {
+ int type;
+ void (*resetExtension)(void);
+ Bool (*initVisuals)(
+ VisualPtr * visualp,
+ DepthPtr * depthp,
+ int * nvisualp,
+ int * ndepthp,
+ int * rootDepthp,
+ VisualID * defaultVisp,
+ unsigned long sizes,
+ int bitsPerRGB
+ );
+ void (*setVisualConfigs)(
+ int nconfigs,
+ __GLXvisualConfig *configs,
+ void **privates
+ );
+} __GLXextensionInfo;
+
+extern GLboolean __glXFreeContext(__GLXcontext *glxc);
+extern void __glXFlushContextCache(void);
+
+extern void __glXNoSuchRenderOpcode(GLbyte*);
+extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
+extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
+extern void __glXClearErrorOccured(void);
+extern GLboolean __glXErrorOccured(void);
+extern void __glXResetLargeCommandStatus(__GLXclientState*);
+
+extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
+extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
+
+extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
+ GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
+extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
+ GLboolean do_swap);
+extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
+ GLboolean do_swap);
+extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
+ GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
+extern int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
+ GLuint screenNum, XID pixmapId, XID glxpixmapId);
+
+extern void GlxExtensionInit(void);
+
+extern Bool __glXCoreType(void);
+
+extern const char GLServerVersion[];
+extern int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap);
+
+extern int GlxInitVisuals(
+ VisualPtr * visualp,
+ DepthPtr * depthp,
+ int * nvisualp,
+ int * ndepthp,
+ int * rootDepthp,
+ VisualID * defaultVisp,
+ unsigned long sizes,
+ int bitsPerRGB,
+ int preferredVis
+);
+
+typedef struct {
+ void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
+ void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
+ int (* destroyHyperpipeConfigFunc)(int, int);
+ void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *);
+} __GLXHyperpipeExtensionFuncs;
+
+extern void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
+
+extern __GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs;
+
+typedef struct {
+ int (* bindSwapBarrierFunc)(int, XID, int);
+ int (* queryMaxSwapBarriersFunc)(int);
+} __GLXSwapBarrierExtensionFuncs;
+
+extern void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
+
+extern __GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs;
+
+#endif /* _glxext_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.c b/nx-X11/programs/Xserver/GL/glx/glxfb.c
new file mode 100644
index 000000000..0d433d25d
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxfb.c
@@ -0,0 +1,183 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+** An implementation of a buffer which is part of the front buffer
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxfb.h"
+
+#include <gcstruct.h>
+
+/* so we don't include glmath.h */
+extern GLuint __glFloorLog2(GLuint);
+
+typedef struct __GLFBbufferInfoRec {
+ GCPtr pGC;
+} __GLFBbufferInfo;
+
+extern PixmapPtr __glXPrivPixGetPtr(__GLdrawableBuffer *);
+
+/* ---------------------------------------------------------- */
+
+static GLboolean
+Resize(__GLdrawableBuffer *buf,
+ GLint x, GLint y, GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv, GLuint bufferMask)
+{
+ buf->width = width;
+ buf->height = height;
+ buf->byteWidth = width * buf->elementSize;
+ buf->outerWidth = width;
+
+ return GL_TRUE;
+}
+
+static void
+Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+static void
+Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+/*
+** Do a swap buffer with
+** a memory surface as a back buffer
+** a FB surface as a front buffer
+*/
+GLboolean
+__glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ __GLdrawableBuffer *front = &glPriv->frontBuffer;
+ __GLdrawableBuffer *back = &glPriv->backBuffer;
+ __GLFBbufferInfo *bufferInfo;
+ GCPtr pGC;
+ GLint width, height, depth, pad;
+ GLubyte *buf;
+
+ bufferInfo = (__GLFBbufferInfo *) front->other;
+ pGC = bufferInfo->pGC;
+
+ width = back->width;
+ height = back->height;
+ depth = back->depth;
+ buf = back->base;
+ pad = back->outerWidth - back->width; /* back buffer padding */
+ /* adjust buffer padding. X wants left, GL has right */
+ buf -= pad;
+
+ ValidateGC(glxPriv->pDraw, pGC);
+ (*pGC->ops->PutImage)(glxPriv->pDraw, pGC,
+ depth,
+ 0, 0, width, height,
+ pad, ZPixmap,
+ (char *)buf);
+
+ return GL_TRUE;
+}
+
+static void
+Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+ __GLFBbufferInfo *bufferInfo;
+
+ bufferInfo = (__GLFBbufferInfo *) buf->other;
+
+ if (bufferInfo->pGC) {
+ FreeScratchGC(bufferInfo->pGC);
+ }
+
+ __glXFree(bufferInfo);
+ buf->other = NULL;
+}
+
+/*
+** function to return the X GC of this buffer (to be used by DDX)
+*/
+GCPtr __glXFBGetGC(__GLdrawableBuffer *buf)
+{
+ __GLFBbufferInfo *bufferInfo;
+
+ bufferInfo = (__GLFBbufferInfo *) buf->other;
+
+ if (bufferInfo) {
+ return bufferInfo->pGC;
+ } else {
+ return NULL;
+ }
+}
+
+
+void
+__glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
+{
+ __GLFBbufferInfo *bufferInfo;
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *) glPriv->other;
+ GCPtr pGC;
+
+ buf->depth = bits;
+ buf->width = buf->height = 0; /* to be filled during Update */
+ buf->handle = buf->base = NULL; /* to be filled during Update */
+ buf->size = 0;
+ buf->byteWidth = 0;
+ buf->elementSize = ((bits-1) / 8) + 1;
+ buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
+
+ buf->resize = Resize;
+ buf->lock = Lock;
+ buf->unlock = Unlock;
+ buf->fill = NULL;
+ buf->free = Free;
+
+ /* allocate local information */
+ bufferInfo = (__GLFBbufferInfo *) __glXMalloc(sizeof(__GLFBbufferInfo));
+ buf->other = (void *) bufferInfo;
+
+ pGC = CreateScratchGC(glxPriv->pDraw->pScreen,
+ glxPriv->pDraw->depth);
+ bufferInfo->pGC = pGC;
+ (*pGC->funcs->ChangeClip)(pGC, CT_NONE, NULL, 0);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.h b/nx-X11/programs/Xserver/GL/glx/glxfb.h
new file mode 100644
index 000000000..325146d43
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxfb.h
@@ -0,0 +1,52 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxfb_h_
+#define _glxfb_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+ GLint bits);
+
+extern GCPtr __glXFBGetGC(__GLdrawableBuffer *buf);
+
+extern GLboolean __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv);
+
+#endif /* _glxfb_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c
new file mode 100644
index 000000000..fae2346b9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glximports.c
@@ -0,0 +1,184 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glximports.c,v 1.5 2001/03/21 16:29:36 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxcontext.h"
+#include "glximports.h"
+#include "GL/glx_ansic.h"
+
+void *__glXImpMalloc(__GLcontext *gc, size_t size)
+{
+ void *addr;
+
+ if (size == 0) {
+ return NULL;
+ }
+ addr = xalloc(size);
+ if (addr == NULL) {
+ /* XXX: handle out of memory error */
+ return NULL;
+ }
+ return addr;
+}
+
+void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
+{
+ void *addr;
+ size_t size;
+
+ if ((numElements == 0) || (elementSize == 0)) {
+ return NULL;
+ }
+ size = numElements * elementSize;
+ addr = xalloc(size);
+ if (addr == NULL) {
+ /* XXX: handle out of memory error */
+ return NULL;
+ }
+ /* zero out memory */
+ __glXMemset(addr, 0, size);
+
+ return addr;
+}
+
+void __glXImpFree(__GLcontext *gc, void *addr)
+{
+ if (addr) {
+ xfree(addr);
+ }
+}
+
+void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
+{
+ void *newAddr;
+
+ if (addr) {
+ if (newSize == 0) {
+ xfree(addr);
+ return NULL;
+ }
+ newAddr = xrealloc(addr, newSize);
+ } else {
+ if (newSize == 0) {
+ return NULL;
+ }
+ newAddr = xalloc(newSize);
+ }
+ if (newAddr == NULL) {
+ return NULL; /* XXX: out of memory error */
+ }
+
+ return newAddr;
+}
+
+void __glXImpWarning(__GLcontext *gc, char *msg)
+{
+ ErrorF((char *)msg);
+}
+
+void __glXImpFatal(__GLcontext *gc, char *msg)
+{
+ ErrorF((char *)msg);
+ __glXAbort();
+}
+
+char *__glXImpGetenv(__GLcontext *gc, const char *var)
+{
+ return __glXGetenv(var);
+}
+
+int __glXImpAtoi(__GLcontext *gc, const char *str)
+{
+ return __glXAtoi(str);
+}
+
+int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ /* have to deal with var args */
+ va_start(ap, fmt);
+ ret = __glXVsprintf(str, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+
+void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode)
+{
+ return (void *) __glXFopen(path, mode);
+}
+
+int __glXImpFclose(__GLcontext *gc, void *stream)
+{
+ return __glXFclose((FILE *)stream);
+}
+
+int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ /* have to deal with var args */
+ va_start(ap, fmt);
+ ret = __glXVfprintf((FILE *)stream, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+
+
+__GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc)
+{
+ __GLinterface *glci = (__GLinterface *) gc;
+ __GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
+
+ return &glrc->drawPriv->glPriv;
+}
+
+
+__GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc)
+{
+ __GLinterface *glci = (__GLinterface *) gc;
+ __GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
+
+ return &glrc->readPriv->glPriv;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.h b/nx-X11/programs/Xserver/GL/glx/glximports.h
new file mode 100644
index 000000000..ef485822e
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glximports.h
@@ -0,0 +1,66 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glximports.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glximports_h_
+#define _glximports_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void *__glXImpMalloc(__GLcontext *gc, size_t size);
+extern void *__glXImpCalloc(__GLcontext *gc, size_t nElem, size_t eSize);
+extern void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize);
+extern void __glXImpFree(__GLcontext *gc, void *addr);
+
+extern void __glXImpWarning(__GLcontext *gc, char *msg);
+extern void __glXImpFatal(__GLcontext *gc, char *msg);
+
+extern char *__glXImpGetenv(__GLcontext *gc, const char *var);
+extern int __glXImpAtoi(__GLcontext *gc, const char *str);
+extern int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...);
+extern void *__glXImpFopen(__GLcontext *gc, const char *path,
+ const char *mode);
+extern int __glXImpFclose(__GLcontext *gc, void *stream);
+extern int __glXImpFprintf(__GLcontext *gc, void *stream,
+ const char *fmt, ...);
+
+extern __GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc);
+extern __GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc);
+
+
+#endif /* _glximports_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxmem.c b/nx-X11/programs/Xserver/GL/glx/glxmem.c
new file mode 100644
index 000000000..21a7c7962
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxmem.c
@@ -0,0 +1,151 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.c,v 1.6 2001/10/31 22:50:27 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+** Implementation of a buffer in main memory
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxmem.h"
+#include "glxext.h"
+#include "GL/internal/glcore.h"
+
+/* don't want to include glmath.h */
+extern GLuint __glFloorLog2(GLuint);
+
+/* ---------------------------------------------------------- */
+
+#define BUF_ALIGN 32 /* x86 cache alignment (used for assembly paths) */
+#define BUF_ALIGN_MASK (BUF_ALIGN-1)
+
+static GLboolean
+Resize(__GLdrawableBuffer *buf,
+ GLint x, GLint y, GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv, GLuint bufferMask)
+{
+ GLuint newSize;
+ void *ubase;
+ GLint pixelWidth;
+ GLint alignedWidth;
+
+ /*
+ ** Note:
+ ** buf->handle : unaligned base
+ ** buf->base : aligned base
+ */
+
+ pixelWidth = BUF_ALIGN / buf->elementSize;
+ alignedWidth = (width & ~(pixelWidth-1)) + pixelWidth;
+
+ newSize = alignedWidth * height * buf->elementSize;
+
+ /*
+ ** Only allocate buffer space for the SGI core.
+ ** Mesa and Aqua handle their own buffer allocations.
+ */
+#if defined(__GL_BUFFER_SIZE_TRACKS_WINDOW)
+ if (__glXCoreType() == GL_CORE_SGI) {
+#else
+ if (newSize > buf->size && __glXCoreType() == GL_CORE_SGI) {
+#endif
+ if (buf->handle) {
+ ubase = (*glPriv->realloc)(buf->handle, newSize + BUF_ALIGN_MASK);
+ if (ubase == NULL) {
+ return GL_FALSE;
+ }
+ } else {
+ ubase = (*glPriv->malloc)(newSize + BUF_ALIGN_MASK);
+ if (ubase == NULL) {
+ return GL_FALSE;
+ }
+ }
+ buf->size = newSize;
+
+ buf->handle = ubase;
+ buf->base = (void *)(((size_t)ubase + BUF_ALIGN_MASK) &
+ (unsigned int) ~BUF_ALIGN_MASK);
+ assert(((size_t)buf->base % BUF_ALIGN) == 0);
+ }
+
+ buf->width = width;
+ buf->height = height;
+ buf->byteWidth = alignedWidth * buf->elementSize;
+ buf->outerWidth = alignedWidth;
+
+ return GL_TRUE;
+}
+
+static void
+Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+static void
+Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+static void
+Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+ if (buf->handle) {
+ (*glPriv->free)(buf->handle);
+ buf->handle = NULL;
+ }
+}
+
+
+void
+__glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
+{
+ buf->width = buf->height = 0; /* to be filled during Update */
+ buf->depth = bits;
+ buf->size = 0;
+ buf->handle = buf->base = NULL; /* to be filled during Update */
+ buf->byteWidth = 0;
+ buf->elementSize = ((bits - 1) / 8) + 1;
+ buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
+
+ buf->resize = Resize;
+ buf->lock = Lock;
+ buf->unlock = Unlock;
+ buf->fill = NULL;
+ buf->free = Free;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxmem.h b/nx-X11/programs/Xserver/GL/glx/glxmem.h
new file mode 100644
index 000000000..06720dfdf
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxmem.h
@@ -0,0 +1,48 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxmem_h_
+#define _glxmem_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void __glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+ GLint bits);
+
+#endif /* _glxmem_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxpix.c b/nx-X11/programs/Xserver/GL/glx/glxpix.c
new file mode 100644
index 000000000..98c033c98
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxpix.c
@@ -0,0 +1,132 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.c,v 1.3 2000/09/26 15:57:02 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+** An implementation of a glx pixmap buffer
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxpix.h"
+
+#include <gcstruct.h>
+
+/* don't want to include glmath.h */
+extern GLuint __glFloorLog2(GLuint);
+
+typedef struct __GLPixBufferInfoRec {
+ GCPtr pGC;
+} __GLPixBufferInfo;
+
+/* ---------------------------------------------------------- */
+
+static GLboolean
+Resize(__GLdrawableBuffer *buf,
+ GLint x, GLint y, GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv, GLuint bufferMask)
+{
+ buf->width = width;
+ buf->height = width;
+ buf->byteWidth = width * buf->elementSize;
+ buf->outerWidth = width;
+
+ return GL_TRUE;
+}
+
+static void
+Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+static void
+Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+}
+
+static void
+Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
+{
+ __GLPixBufferInfo *bufferInfo;
+
+ if (LookupIDByType((XID)(long)buf->handle, __glXPixmapRes)) {
+ FreeResource((XID)(long)buf->handle, FALSE);
+ buf->handle = NULL;
+ }
+
+ bufferInfo = (__GLPixBufferInfo *) buf->other;
+
+ if (bufferInfo->pGC) {
+ FreeScratchGC(bufferInfo->pGC);
+ }
+
+ __glXFree(bufferInfo);
+ buf->other = NULL;
+}
+
+void
+__glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+ GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap)
+{
+ __GLPixBufferInfo *bufferInfo;
+
+ buf->width = buf->height = 0; /* to be filled during Update */
+ buf->depth = bits;
+ buf->size = 0;
+ buf->base = NULL;
+ buf->byteWidth = 0;
+ buf->elementSize = ((bits-1) / 8) + 1;
+ buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
+
+ buf->handle = (void *)(long) glxpixmapId;
+ pGlxPixmap->refcnt++;
+
+ buf->resize = Resize;
+ buf->lock = Lock;
+ buf->unlock = Unlock;
+ buf->fill = NULL;
+ buf->free = Free;
+
+ /* allocate local information */
+ bufferInfo = (__GLPixBufferInfo *) __glXMalloc(sizeof(__GLPixBufferInfo));
+ buf->other = (void *) bufferInfo;
+
+ bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen,
+ pGlxPixmap->pDraw->depth);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxpix.h b/nx-X11/programs/Xserver/GL/glx/glxpix.h
new file mode 100644
index 000000000..4b16352b4
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxpix.h
@@ -0,0 +1,48 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxpix_h_
+#define _glxpix_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+ GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap);
+
+#endif /* _glxpix_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c
new file mode 100644
index 000000000..58b38b1a2
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c
@@ -0,0 +1,378 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.14 2004/02/09 23:46:31 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifdef IN_MODULE
+#include <xf86_ansic.h>
+#else
+#include <string.h>
+#include <signal.h>
+#endif
+
+#include <windowstr.h>
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxext.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 "
+ "GL_ARB_texture_cube_map "
+ "GL_ARB_texture_env_add "
+ "GL_ARB_texture_env_combine "
+ "GL_ARB_texture_env_crossbar "
+ "GL_ARB_texture_env_dot3 "
+ "GL_ARB_texture_mirrored_repeat "
+ "GL_ARB_transpose_matrix "
+ "GL_ARB_window_pos "
+ "GL_EXT_abgr "
+ "GL_EXT_bgra "
+ "GL_EXT_blend_color "
+ "GL_EXT_blend_func_separate "
+ "GL_EXT_blend_logic_op "
+ "GL_EXT_blend_minmax "
+ "GL_EXT_blend_subtract "
+ "GL_EXT_clip_volume_hint "
+ "GL_EXT_copy_texture "
+ "GL_EXT_draw_range_elements "
+ "GL_EXT_fog_coord "
+ "GL_EXT_multi_draw_arrays "
+ "GL_EXT_packed_pixels "
+ "GL_EXT_polygon_offset "
+ "GL_EXT_rescale_normal "
+ "GL_EXT_secondary_color "
+ "GL_EXT_separate_specular_color "
+ "GL_EXT_shadow_funcs "
+ "GL_EXT_stencil_two_side "
+ "GL_EXT_stencil_wrap "
+ "GL_EXT_subtexture "
+ "GL_EXT_texture "
+ "GL_EXT_texture3D "
+ "GL_EXT_texture_edge_clamp "
+ "GL_EXT_texture_env_add "
+ "GL_EXT_texture_env_combine "
+ "GL_EXT_texture_env_dot3 "
+ "GL_EXT_texture_lod "
+ "GL_EXT_texture_lod_bias "
+ "GL_EXT_texture_object "
+ "GL_EXT_texture_rectangle "
+ "GL_EXT_vertex_array "
+ "GL_APPLE_packed_pixels "
+ "GL_ATI_texture_mirror_once "
+ "GL_ATI_texture_env_combine3 "
+ "GL_HP_occlusion_test "
+ "GL_IBM_texture_mirrored_repeat "
+ "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 "
+ "GL_SGIS_texture_border_clamp "
+ "GL_SGIS_texture_edge_clamp "
+ "GL_SGIS_texture_lod "
+ "GL_SGIX_depth_texture "
+ "GL_SGIX_shadow "
+ "GL_SGIX_shadow_ambient "
+ ;
+
+/*
+** We have made the simplifying assuption that the same extensions are
+** supported across all screens in a multi-screen system.
+*/
+static char GLXServerVendorName[] = "SGI";
+static char GLXServerVersion[] = "1.2";
+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 "
+#ifndef __DARWIN__
+ "GLX_SGIS_multisample "
+ "GLX_SGIX_hyperpipe "
+ "GLX_SGIX_swap_barrier "
+#endif
+ "GLX_SGIX_fbconfig "
+ ;
+
+/*
+ * __glDDXScreenInfo comes from GLcore, so we can't resolve this symbol at
+ * module open time. Leave a placeholder, and fill this in when we first
+ * need it (in __glXScreenInit). XXX Why make this an array?
+ */
+static __GLXscreenInfo *__glXScreens[] = {
+ NULL /* &__glDDXScreenInfo */ ,
+};
+
+static GLint __glXNumStaticScreens =
+ (sizeof __glXScreens / sizeof __glXScreens[0]);
+
+__GLXscreenInfo *__glXActiveScreens;
+GLint __glXNumActiveScreens;
+
+__GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs = NULL;
+static int __glXNumSwapBarrierFuncs = 0;
+__GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs = NULL;
+static int __glXNumHyperpipeFuncs = 0;
+
+
+RESTYPE __glXDrawableRes;
+
+__GLXscreenInfo *__glXgetActiveScreen(int num) {
+ return &__glXActiveScreens[num];
+}
+
+/*
+** Destroy routine that gets called when a drawable is freed. A drawable
+** contains the ancillary buffers needed for rendering.
+*/
+static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
+{
+ __GLXcontext *cx, *cx1;
+
+ /*
+ ** Use glxPriv->type to figure out what kind of drawable this is. Don't
+ ** use glxPriv->pDraw->type because by the time this routine is called,
+ ** the pDraw might already have been freed.
+ */
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ /*
+ ** When a window is destroyed, notify all context bound to
+ ** it, that there are no longer bound to anything.
+ */
+ for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
+ cx1 = cx->nextDrawPriv;
+ cx->pendingState |= __GLX_PENDING_DESTROY;
+ }
+
+ for (cx = glxPriv->readGlxc; cx; cx = cx1) {
+ cx1 = cx->nextReadPriv;
+ cx->pendingState |= __GLX_PENDING_DESTROY;
+ }
+ }
+
+ /*
+ ** set the size to 0, so that context that may still be using this
+ ** drawable not do anything harmful
+ */
+ glxPriv->xorigin = 0;
+ glxPriv->yorigin = 0;
+ glxPriv->width = 0;
+ glxPriv->height = 0;
+
+ __glXUnrefDrawablePrivate(glxPriv);
+
+ return True;
+}
+
+/*
+** This hook gets called when a window moves or changes size.
+*/
+static Bool PositionWindow(WindowPtr pWin, int x, int y)
+{
+ ScreenPtr pScreen;
+ __GLXcontext *glxc;
+ __GLXdrawablePrivate *glxPriv;
+ Bool ret;
+
+ /*
+ ** Call wrapped position window routine
+ */
+ pScreen = pWin->drawable.pScreen;
+ pScreen->PositionWindow =
+ __glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
+ ret = (*pScreen->PositionWindow)(pWin, x, y);
+ pScreen->PositionWindow = PositionWindow;
+
+ /*
+ ** Tell all contexts rendering into this window that the window size
+ ** has changed.
+ */
+ glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
+ __glXDrawableRes);
+ if (glxPriv == NULL) {
+ /*
+ ** This window is not being used by the OpenGL.
+ */
+ return ret;
+ }
+
+ /*
+ ** resize the drawable
+ */
+ /* first change the drawable size */
+ if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
+ /* resize failed! */
+ /* XXX: what can we possibly do here? */
+ ret = False;
+ }
+
+ /* mark contexts as needing resize */
+
+ for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
+ glxc->pendingState |= __GLX_PENDING_RESIZE;
+ }
+
+ for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
+ glxc->pendingState |= __GLX_PENDING_RESIZE;
+ }
+
+ return ret;
+}
+
+/*
+** Wrap our own PositionWindow routine around the server's, so we can
+** be notified when a window changes size
+*/
+static void wrapPositionWindow(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+
+ __glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
+ pScreen->PositionWindow = PositionWindow;
+}
+
+/*
+ * If your DDX driver wants to register support for swap barriers or hyperpipe
+ * topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
+ * with a dispatch table of functions to handle the requests. In the XFree86
+ * DDX, for example, you would call these near the bottom of the driver's
+ * ScreenInit method, after DRI has been initialized.
+ *
+ * This should be replaced with a better method when we teach the server how
+ * to load DRI drivers.
+ */
+
+void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs)
+{
+ if (__glXNumHyperpipeFuncs < screen + 1) {
+ __glXHyperpipeFuncs = __glXRealloc(__glXHyperpipeFuncs,
+ (screen+1) * sizeof(__GLXHyperpipeExtensionFuncs));
+ __glXNumHyperpipeFuncs = screen + 1;
+ }
+
+ __glXHyperpipeFuncs[screen].queryHyperpipeNetworkFunc =
+ *funcs->queryHyperpipeNetworkFunc;
+ __glXHyperpipeFuncs[screen].queryHyperpipeConfigFunc =
+ *funcs->queryHyperpipeConfigFunc;
+ __glXHyperpipeFuncs[screen].destroyHyperpipeConfigFunc =
+ *funcs->destroyHyperpipeConfigFunc;
+ __glXHyperpipeFuncs[screen].hyperpipeConfigFunc =
+ *funcs->hyperpipeConfigFunc;
+}
+
+void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
+{
+ if (__glXNumSwapBarrierFuncs < screen + 1) {
+ __glXSwapBarrierFuncs = __glXRealloc(__glXSwapBarrierFuncs,
+ (screen+1) * sizeof(__GLXSwapBarrierExtensionFuncs));
+ __glXNumSwapBarrierFuncs = screen + 1;
+ }
+
+ __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc =
+ funcs->bindSwapBarrierFunc;
+ __glXSwapBarrierFuncs[screen].queryMaxSwapBarriersFunc =
+ funcs->queryMaxSwapBarriersFunc;
+}
+
+void __glXScreenInit(GLint numscreens)
+{
+ GLint i,j;
+
+ __glXScreens[0] = __glXglDDXScreenInfo(); /* from GLcore */
+
+ /*
+ ** This alloc has to work or else the server might as well core dump.
+ */
+ __glXActiveScreens =
+ (__GLXscreenInfo *) __glXMalloc(sizeof(__GLXscreenInfo) * numscreens);
+
+ for (i=0; i < numscreens; i++) {
+ /*
+ ** Probe each static screen to see which exists.
+ */
+ for (j=0; j < __glXNumStaticScreens; j++) {
+ if ((*__glXScreens[j]->screenProbe)(i)) {
+ __glXActiveScreens[i] = *__glXScreens[j];
+
+ __glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
+ __glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
+ __glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
+ __glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);
+ __glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions);
+
+ __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
+ wrapPositionWindow(i);
+ }
+ }
+ }
+ __glXNumActiveScreens = numscreens;
+}
+
+void __glXScreenReset(void)
+{
+ int i;
+
+ for (i = 0; i < __glXNumActiveScreens; i++) {
+ __glXFree(__glXActiveScreens[i].GLXvendor);
+ __glXFree(__glXActiveScreens[i].GLXversion);
+ __glXFree(__glXActiveScreens[i].GLXextensions);
+ __glXFree(__glXActiveScreens[i].GLextensions);
+ }
+ xfree(__glXActiveScreens);
+ xfree(__glXHyperpipeFuncs);
+ xfree(__glXSwapBarrierFuncs);
+ __glXNumHyperpipeFuncs = 0;
+ __glXNumSwapBarrierFuncs = 0;
+ __glXHyperpipeFuncs = NULL;
+ __glXSwapBarrierFuncs = NULL;
+ __glXActiveScreens = NULL;
+ __glXNumActiveScreens = 0;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.h b/nx-X11/programs/Xserver/GL/glx/glxscreens.h
new file mode 100644
index 000000000..2d68c8b60
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.h
@@ -0,0 +1,103 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_screens_h_
+#define _GLX_screens_h_
+
+/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.h,v 1.4 2001/03/21 16:29:37 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* XXX: should be defined somewhere globally */
+#define CAPI
+
+#include "GL/internal/glcore.h"
+
+/*
+** Screen dependent data. These methods are the interface between the DIX
+** and DDX layers of the GLX server extension. The methods provide an
+** interface for context management on a screen.
+*/
+typedef struct {
+ /*
+ ** Probe the screen and see if it supports GL rendering. It will
+ ** return GL_FALSE if it doesn't, GL_TRUE otherwise.
+ */
+ Bool (*screenProbe)(int screen);
+
+ /*
+ ** Create a context using configuration information from modes.
+ ** Use imports as callbacks back to the OS. Return an opaque handle
+ ** on the context (NULL if failure).
+ */
+ __GLinterface *(*createContext)(__GLimports *imports,
+ __GLcontextModes *modes,
+ __GLinterface *shareGC);
+
+ /*
+ ** Create a buffer using information from glxPriv. This routine
+ ** sets up any wrappers necessary to resize, swap or destroy the
+ ** buffer.
+ */
+ void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
+
+ /**
+ * Linked list of valid context modes for this screen.
+ */
+ __GLcontextModes *modes;
+
+ void **pVisualPriv;
+ GLint numVisuals;
+ GLint numUsableVisuals;
+
+ char *GLextensions;
+
+ char *GLXvendor;
+ char *GLXversion;
+ char *GLXextensions;
+
+ /*
+ ** Things that are not statically set.
+ */
+ Bool (*WrappedPositionWindow)(WindowPtr pWin, int x, int y);
+
+} __GLXscreenInfo;
+
+
+extern void __glXScreenInit(GLint);
+extern void __glXScreenReset(void);
+
+#endif /* !__GLX_screens_h__ */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h
new file mode 100644
index 000000000..e8449b2bb
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h
@@ -0,0 +1,287 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.5 2003/09/28 20:15:43 alanh Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_server_h_
+#define _GLX_server_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/Xmd.h>
+#include <misc.h>
+#include <dixstruct.h>
+#include <pixmapstr.h>
+#include <gcstruct.h>
+#include <extnsionst.h>
+#include <resource.h>
+#include <scrnintstr.h>
+#include "GL/glx_ansic.h"
+
+
+/*
+** The X header misc.h defines these math functions.
+*/
+#undef abs
+#undef fabs
+
+#define GL_GLEXT_PROTOTYPES /* we want prototypes */
+#include <GL/gl.h>
+#include <GL/glxproto.h>
+#include <GL/glxint.h>
+
+/* For glxscreens.h */
+typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
+
+#include "glxscreens.h"
+#include "glxdrawable.h"
+#include "glxcontext.h"
+#include "glxerror.h"
+
+
+#define GLX_SERVER_MAJOR_VERSION 1
+#define GLX_SERVER_MINOR_VERSION 2
+
+#ifndef True
+#define True 1
+#endif
+#ifndef False
+#define False 0
+#endif
+
+/*
+** GLX resources.
+*/
+typedef XID GLXContextID;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef struct __GLXclientStateRec __GLXclientState;
+
+extern __GLXscreenInfo *__glXActiveScreens;
+extern GLint __glXNumActiveScreens;
+extern __GLXscreenInfo *__glXgetActiveScreen(int num);
+
+/************************************************************************/
+
+/*
+** The last context used (from the server's persective) is cached.
+*/
+extern __GLXcontext *__glXLastContext;
+extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
+
+/*
+** Macros to set, unset, and retrieve the flag that says whether a context
+** has unflushed commands.
+*/
+#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
+#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
+#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
+
+/************************************************************************/
+
+/*
+** State kept per client.
+*/
+struct __GLXclientStateRec {
+ /*
+ ** Whether this structure is currently being used to support a client.
+ */
+ Bool inUse;
+
+ /*
+ ** Buffer for returned data.
+ */
+ GLbyte *returnBuf;
+ GLint returnBufSize;
+
+ /*
+ ** Keep track of large rendering commands, which span multiple requests.
+ */
+ GLint largeCmdBytesSoFar; /* bytes received so far */
+ GLint largeCmdBytesTotal; /* total bytes expected */
+ GLint largeCmdRequestsSoFar; /* requests received so far */
+ GLint largeCmdRequestsTotal; /* total requests expected */
+ GLbyte *largeCmdBuf;
+ GLint largeCmdBufSize;
+
+ /*
+ ** Keep a list of all the contexts that are current for this client's
+ ** threads.
+ */
+ __GLXcontext **currentContexts;
+ GLint numCurrentContexts;
+
+ /* Back pointer to X client record */
+ ClientPtr client;
+
+ int GLClientmajorVersion;
+ int GLClientminorVersion;
+ char *GLClientextensions;
+};
+
+extern __GLXclientState *__glXClients[];
+
+/************************************************************************/
+
+/*
+** Dispatch tables.
+*/
+typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
+typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
+typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
+
+/*
+ * Dispatch for GLX commands.
+ */
+typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
+extern __GLXprocPtr __glXProcTable[];
+
+/*
+ * Tables for computing the size of each rendering command.
+ */
+typedef struct {
+ int bytes;
+ int (*varsize)(GLbyte *pc, Bool swap);
+} __GLXrenderSizeData;
+extern __GLXrenderSizeData __glXRenderSizeTable[];
+extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
+
+/************************************************************************/
+
+/*
+** X resources.
+*/
+extern RESTYPE __glXContextRes;
+extern RESTYPE __glXClientRes;
+extern RESTYPE __glXPixmapRes;
+extern RESTYPE __glXDrawableRes;
+
+/************************************************************************/
+
+/*
+** Prototypes.
+*/
+
+extern char *__glXcombine_strings(const char *, const char *);
+
+/*
+** Routines for sending swapped replies.
+*/
+
+extern void __glXSwapMakeCurrentReply(ClientPtr client,
+ xGLXMakeCurrentReply *reply);
+extern void __glXSwapIsDirectReply(ClientPtr client,
+ xGLXIsDirectReply *reply);
+extern void __glXSwapQueryVersionReply(ClientPtr client,
+ xGLXQueryVersionReply *reply);
+extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
+ xGLXQueryContextInfoEXTReply *reply,
+ int *buf);
+extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply *reply, char *buf);
+extern void glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply *reply, char *buf);
+
+
+/*
+ * Routines for computing the size of variably-sized rendering commands.
+ */
+
+extern int __glXTypeSize(GLenum enm);
+extern int __glXImageSize(GLenum format, GLenum type,
+ GLenum target, GLsizei w, GLsizei h, GLsizei d,
+ GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
+ GLint alignment);
+
+extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
+extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
+extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
+extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
+extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
+extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
+extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
+extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
+
+/*
+ * Routines for computing the size of returned data.
+ */
+extern int __glXConvolutionParameterivSize(GLenum pname);
+extern int __glXConvolutionParameterfvSize(GLenum pname);
+extern int __glXColorTableParameterfvSize(GLenum pname);
+extern int __glXColorTableParameterivSize(GLenum pname);
+
+extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap);
+extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap);
+
+#endif /* !__GLX_server_h__ */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c
new file mode 100644
index 000000000..03bc19f63
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c
@@ -0,0 +1,507 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#define FONT_PCF
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include <GL/glxtokens.h>
+#include <unpack.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include "glxutil.h"
+#include "glxbuf.h"
+#include "GL/glx_ansic.h"
+#include "GL/internal/glcore.h"
+#include "GL/glxint.h"
+#include "glcontextmodes.h"
+
+/************************************************************************/
+
+void __glXNop(void) {}
+
+/************************************************************************/
+
+/* Memory Allocation for GLX */
+
+void *
+__glXMalloc(size_t size)
+{
+ void *addr;
+
+ if (size == 0) {
+ return NULL;
+ }
+ addr = (void *) xalloc(size);
+ if (addr == NULL) {
+ /* XXX: handle out of memory error */
+ return NULL;
+ }
+ return addr;
+}
+
+void *
+__glXCalloc(size_t numElements, size_t elementSize)
+{
+ void *addr;
+ size_t size;
+
+ if ((numElements == 0) || (elementSize == 0)) {
+ return NULL;
+ }
+ size = numElements * elementSize;
+ addr = (void *) xalloc(size);
+ if (addr == NULL) {
+ /* XXX: handle out of memory error */
+ return NULL;
+ }
+ __glXMemset(addr, 0, size);
+ return addr;
+}
+
+void *
+__glXRealloc(void *addr, size_t newSize)
+{
+ void *newAddr;
+
+ if (addr) {
+ if (newSize == 0) {
+ xfree(addr);
+ return NULL;
+ } else {
+ newAddr = xrealloc(addr, newSize);
+ }
+ } else {
+ if (newSize == 0) {
+ return NULL;
+ } else {
+ newAddr = xalloc(newSize);
+ }
+ }
+ if (newAddr == NULL) {
+ return NULL; /* XXX: out of memory */
+ }
+
+ return newAddr;
+}
+
+void
+__glXFree(void *addr)
+{
+ if (addr) {
+ xfree(addr);
+ }
+}
+
+/************************************************************************/
+/* Context stuff */
+
+
+/*
+** associate a context with a drawable
+*/
+void
+__glXAssociateContext(__GLXcontext *glxc)
+{
+ glxc->nextDrawPriv = glxc->drawPriv->drawGlxc;
+ glxc->drawPriv->drawGlxc = glxc;
+
+ __glXRefDrawablePrivate(glxc->drawPriv);
+
+
+ glxc->nextReadPriv = glxc->readPriv->readGlxc;
+ glxc->readPriv->readGlxc = glxc;
+
+ __glXRefDrawablePrivate(glxc->readPriv);
+}
+
+/*
+** Deassociate a context from a drawable
+*/
+void
+__glXDeassociateContext(__GLXcontext *glxc)
+{
+ __GLXcontext *curr, *prev;
+
+ prev = NULL;
+ for ( curr = glxc->drawPriv->drawGlxc
+ ; curr != NULL
+ ; prev = curr, curr = curr->nextDrawPriv ) {
+ if (curr == glxc) {
+ /* found context. Deassociate. */
+ if (prev == NULL) {
+ glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
+ } else {
+ prev->nextDrawPriv = curr->nextDrawPriv;
+ }
+ curr->nextDrawPriv = NULL;
+ __glXUnrefDrawablePrivate(glxc->drawPriv);
+ break;
+ }
+ }
+
+
+ prev = NULL;
+ for ( curr = glxc->readPriv->readGlxc
+ ; curr != NULL
+ ; prev = curr, curr = curr->nextReadPriv ) {
+ if (curr == glxc) {
+ /* found context. Deassociate. */
+ if (prev == NULL) {
+ glxc->readPriv->readGlxc = curr->nextReadPriv;
+ } else {
+ prev->nextReadPriv = curr->nextReadPriv;
+ }
+ curr->nextReadPriv = NULL;
+ __glXUnrefDrawablePrivate(glxc->readPriv);
+ break;
+ }
+ }
+}
+
+/************************************************************************/
+
+void
+__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
+ GLint *x, GLint *y, GLuint *width, GLuint *height)
+{
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+ if (glxPriv) {
+ *x = glxPriv->xorigin;
+ *y = glxPriv->yorigin;
+ *width = glxPriv->width;
+ *height = glxPriv->height;
+ } else {
+ *x = *y = *width = *height = 0;
+ }
+}
+
+GLboolean
+__glXResizeDrawable(__GLdrawablePrivate *glPriv)
+{
+ /* nothing to be done here */
+ return GL_TRUE;
+}
+
+
+/*****************************************************************************/
+/* accessing the drawable private */
+
+static void
+LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
+{
+ __GLinterface *glci = (__GLinterface *) gc;
+ __GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
+
+ /* quick exit test */
+ if ((glxc->pendingState &
+ (__GLX_PENDING_RESIZE |
+ __GLX_PENDING_DESTROY |
+ __GLX_PENDING_SWAP)) == 0x0)
+ return;
+
+ /* some pending state. Deal with it */
+ if (glxc->pendingState & __GLX_PENDING_RESIZE) {
+ glxc->pendingState &= ~__GLX_PENDING_RESIZE;
+
+ (*glci->exports.notifyResize)(gc);
+ assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
+ }
+ if (glxc->pendingState & __GLX_PENDING_DESTROY) {
+ glxc->pendingState &= ~__GLX_PENDING_DESTROY;
+
+ assert(glxc->drawPriv->xorigin == 0);
+ assert(glxc->drawPriv->yorigin == 0);
+ assert(glxc->drawPriv->width == 0);
+ assert(glxc->drawPriv->height == 0);
+ assert(glxc->readPriv->xorigin == 0);
+ assert(glxc->readPriv->yorigin == 0);
+ assert(glxc->readPriv->width == 0);
+ assert(glxc->readPriv->height == 0);
+ (*glci->exports.notifyDestroy)(gc);
+ __glXDeassociateContext(glxc);
+ assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
+ }
+ if (glxc->pendingState & __GLX_PENDING_SWAP) {
+
+ glxc->pendingState &= ~__GLX_PENDING_SWAP;
+
+ (*glci->exports.notifySwapBuffers)(gc);
+ assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
+ }
+}
+
+static void
+UnlockDP(__GLdrawablePrivate *glPriv)
+{
+}
+
+/*****************************************************************************/
+/* Drawable private stuff */
+
+void
+__glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
+{
+ glxPriv->refCount++;
+}
+
+void
+__glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
+{
+ glxPriv->refCount--;
+ if (glxPriv->refCount == 0) {
+ __glXDestroyDrawablePrivate(glxPriv);
+ }
+}
+
+__GLXdrawablePrivate *
+__glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
+ __GLcontextModes *modes)
+{
+ __GLXdrawablePrivate *glxPriv;
+ __GLdrawablePrivate *glPriv;
+ __GLXscreenInfo *pGlxScreen;
+
+ glxPriv = (__GLXdrawablePrivate *) __glXMalloc(sizeof(*glxPriv));
+ __glXMemset(glxPriv, 0, sizeof(__GLXdrawablePrivate));
+
+ glxPriv->type = pDraw->type;
+ glxPriv->pDraw = pDraw;
+ glxPriv->drawId = drawId;
+
+ /* if not a pixmap, lookup will fail, so pGlxPixmap will be NULL */
+ glxPriv->pGlxPixmap = (__GLXpixmap *)
+ LookupIDByType(drawId, __glXPixmapRes);
+ /* since we are creating the drawablePrivate, drawId should be new */
+ if (!AddResource(drawId, __glXDrawableRes, glxPriv)) {
+ /* oops! */
+ __glXFree(glxPriv);
+ return NULL;
+ }
+
+ /* fill up glPriv */
+ glPriv = &glxPriv->glPriv;
+ glPriv->modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes));
+ *glPriv->modes = *modes;
+ glPriv->malloc = __glXMalloc;
+ glPriv->calloc = __glXCalloc;
+ glPriv->realloc = __glXRealloc;
+ glPriv->free = __glXFree;
+ glPriv->addSwapRect = NULL;
+ glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
+ glPriv->lockDP = LockDP;
+ glPriv->unlockDP = UnlockDP;
+ glPriv->getDrawableSize = __glXGetDrawableSize;
+ glPriv->resize = __glXResizeDrawable;
+ glPriv->other = glxPriv;
+
+ /* allocate a one-rect ownership region */
+ glPriv->ownershipRegion.rects =
+ (__GLregionRect *)__glXCalloc(1, sizeof(__GLregionRect));
+ glPriv->ownershipRegion.numRects = 1;
+
+ glxPriv->freeBuffers = __glXFreeBuffers;
+ glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
+
+ pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
+
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ VisualID vid = wVisual((WindowPtr)pDraw);
+
+ glxPriv->modes = _gl_context_modes_find_visual( pGlxScreen->modes, vid );
+ __glXFBInitDrawable(glxPriv, modes);
+ } else {
+ glxPriv->modes = glxPriv->pGlxPixmap->modes;
+ __glXPixInitDrawable(glxPriv, modes);
+ }
+
+ /* initialize the core's private buffer information */
+ (*pGlxScreen->createBuffer)(glxPriv);
+
+ return glxPriv;
+}
+
+GLboolean
+__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
+{
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+
+ /* remove the drawable from the drawable list */
+ FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
+
+ /* Have the core free any memory it may have attached to the drawable */
+ if (glPriv->freePrivate) {
+ (*glPriv->freePrivate)(glPriv);
+ }
+
+ /* Free any framebuffer memory attached to the drawable */
+ if (glxPriv->freeBuffers) {
+ (*glxPriv->freeBuffers)(glxPriv);
+ }
+
+ /* Free the drawable Private */
+ __glXFree(glxPriv->glPriv.modes);
+ __glXFree(glxPriv->glPriv.ownershipRegion.rects);
+ __glXFree(glxPriv);
+
+ return GL_TRUE;
+}
+
+__GLXdrawablePrivate *
+__glXFindDrawablePrivate(XID drawId)
+{
+ __GLXdrawablePrivate *glxPriv;
+
+ glxPriv = (__GLXdrawablePrivate *)LookupIDByType(drawId, __glXDrawableRes);
+
+ return glxPriv;
+}
+
+__GLXdrawablePrivate *
+__glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
+ __GLcontextModes *modes)
+{
+ __GLXdrawablePrivate *glxPriv;
+
+ glxPriv = __glXFindDrawablePrivate(drawId);
+
+ if (glxPriv == NULL) {
+ glxPriv = __glXCreateDrawablePrivate(pDraw, drawId, modes);
+ if (glxPriv) {
+ __glXRefDrawablePrivate(glxPriv);
+ }
+ }
+
+ return glxPriv;
+}
+
+void
+__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
+{
+ if (glxPriv) {
+ if (glxPriv->pDraw) {
+ glxPriv->xorigin = glxPriv->pDraw->x;
+ glxPriv->yorigin = glxPriv->pDraw->y;
+ glxPriv->width = glxPriv->pDraw->width;
+ glxPriv->height = glxPriv->pDraw->height;
+ }
+ }
+}
+
+/*
+** resize/move the drawable. Called during the actual resize callback
+** to update the drawable side of the buffers
+*/
+GLboolean
+__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ GLint x, y;
+ GLuint w, h;
+#if defined(__GL_ALIGNED_BUFFERS)
+ GLint xAlignment, yAlignment;
+ GLint xOffset, yOffset;
+ GLint xStart, xEnd;
+ GLint yStart, yEnd;
+ GLuint xAlignedMask, yAlignedMask;
+#endif
+ GLboolean status = GL_TRUE;
+
+ __glXCacheDrawableSize(glxPriv);
+
+ w = glxPriv->width;
+ h = glxPriv->height;
+ x = glxPriv->xorigin;
+ y = glxPriv->yorigin;
+
+#if defined(__GL_ALIGNED_BUFFERS)
+ xAlignment = glPriv->xAlignment;
+ yAlignment = glPriv->yAlignment;
+
+ xOffset = x & (xAlignment-1);
+ yOffset = y & (yAlignment-1);
+
+ xAlignedMask = ~(xAlignment-1);
+ yAlignedMask = ~(yAlignment-1);
+
+ xStart = x; xEnd = x+w;
+ yStart = y; yEnd = y+h;
+
+ xStart &= xAlignedMask;
+ if (xEnd & ~xAlignedMask) {
+ xEnd = (xEnd&xAlignedMask) + xAlignment;
+ }
+ yStart &= yAlignedMask;
+ if (yEnd & ~yAlignedMask) {
+ yEnd = (yEnd&yAlignedMask) + yAlignment;
+ }
+
+ x = xStart; y = yStart;
+ w = xEnd-xStart; h = yEnd-yStart;
+#endif
+
+ if ((x != glPriv->xOrigin) ||
+ (y != glPriv->yOrigin) ||
+#if defined(__GL_ALIGNED_BUFFERS)
+ (xOffset != glPriv->xOffset) ||
+ (yOffset != glPriv->yOffset) ||
+#endif
+ (w != glPriv->width) ||
+ (h != glPriv->height) ||
+ (!w && !h)) {
+ /* set up the glPriv info */
+ glPriv->width = w;
+ glPriv->height = h;
+ glPriv->xOrigin = x;
+ glPriv->yOrigin = y;
+#if defined(__GL_ALIGNED_BUFFERS)
+ glPriv->xOffset = xOffset;
+ glPriv->yOffset = yOffset;
+#endif
+
+ /* notify the buffers */
+ status = __glXResizeBuffers(glPriv, x, y, w, h);
+ }
+
+ return status;
+}
+
+/************************************************************************/
+
diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.h b/nx-X11/programs/Xserver/GL/glx/glxutil.h
new file mode 100644
index 000000000..2c3090a46
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/glxutil.h
@@ -0,0 +1,84 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glxcmds_h_
+#define _glxcmds_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+extern void __glXNop(void);
+
+/* memory management */
+extern void *__glXMalloc(size_t size);
+extern void *__glXCalloc(size_t numElements, size_t elementSize);
+extern void *__glXRealloc(void *addr, size_t newSize);
+extern void __glXFree(void *ptr);
+
+/* relate contexts with drawables */
+extern void __glXAssociateContext(__GLXcontext *glxc);
+extern void __glXDeassociateContext(__GLXcontext *glxc);
+
+/* drawable operation */
+extern void __glXGetDrawableSize(__GLdrawablePrivate *glPriv,
+ GLint *x, GLint *y,
+ GLuint *width, GLuint *height);
+extern GLboolean __glXResizeDrawable(__GLdrawablePrivate *glPriv);
+extern GLboolean __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv);
+
+/* drawable management */
+extern void __glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
+extern void __glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
+extern __GLXdrawablePrivate *__glXCreateDrawablePrivate(DrawablePtr pDraw,
+ XID glxpixmapId,
+ __GLcontextModes *modes);
+extern GLboolean __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv);
+extern __GLXdrawablePrivate *__glXFindDrawablePrivate(XID glxpixmapId);
+extern __GLXdrawablePrivate *__glXGetDrawablePrivate(DrawablePtr pDraw,
+ XID glxpixmapId,
+ __GLcontextModes *modes);
+extern void __glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv);
+
+/* context helper routines */
+extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
+
+/* init helper routines */
+extern void *__glXglDDXScreenInfo(void);
+extern void *__glXglDDXExtensionInfo(void);
+
+#endif /* _glxcmds_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/impsize.h b/nx-X11/programs/Xserver/GL/glx/impsize.h
new file mode 100644
index 000000000..0eaebb6d5
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/impsize.h
@@ -0,0 +1,56 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _impsize_h_
+#define _impsize_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/*
+** These are defined in libsampleGL.a. They are not technically part of
+** the defined interface between libdixGL.a and libsampleGL.a (that interface
+** being the functions in the __glXScreenInfo structure, plus the OpenGL API
+** itself), but we thought it was better to call these routines than to
+** replicate the code in here.
+*/
+
+#include "indirect_size.h"
+
+extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h);
+
+#endif /* _impsize_h_ */
diff --git a/nx-X11/programs/Xserver/GL/glx/module/Imakefile b/nx-X11/programs/Xserver/GL/glx/module/Imakefile
new file mode 100644
index 000000000..d063bc28d
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/module/Imakefile
@@ -0,0 +1,4 @@
+#define IHaveModules
+#define LinkDirectory ..
+
+#include "../Imakefile"
diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c b/nx-X11/programs/Xserver/GL/glx/render2.c
new file mode 100644
index 000000000..f4491b276
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2.c
@@ -0,0 +1,271 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <glxserver.h>
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "indirect_size.h"
+
+void __glXDisp_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_Map1d(GLbyte *pc)
+{
+ GLint order, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+ GLdouble u1, u2, *points;
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (order < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (vorder < 0 || uorder < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ pc += 44;
+
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+ glCallLists(n, type, pc + 8);
+}
+
+void __glXDisp_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glSecondaryColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_FOG_COORD_ARRAY:
+ glEnableClientState(GL_FOG_COORD_ARRAY);
+ glFogCoordPointer(datatype, stride, pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+ glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glDisableClientState(GL_FOG_COORD_ARRAY);
+}
+
+void __glXDisp_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDisp_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original b/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original
new file mode 100644
index 000000000..f4491b276
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original
@@ -0,0 +1,271 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <glxserver.h>
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "indirect_size.h"
+
+void __glXDisp_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_Map1d(GLbyte *pc)
+{
+ GLint order, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+ GLdouble u1, u2, *points;
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (order < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (vorder < 0 || uorder < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ pc += 44;
+
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+ glCallLists(n, type, pc + 8);
+}
+
+void __glXDisp_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glSecondaryColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_FOG_COORD_ARRAY:
+ glEnableClientState(GL_FOG_COORD_ARRAY);
+ glFogCoordPointer(datatype, stride, pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+ glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glDisableClientState(GL_FOG_COORD_ARRAY);
+}
+
+void __glXDisp_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDisp_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c.X.original b/nx-X11/programs/Xserver/GL/glx/render2.c.X.original
new file mode 100644
index 000000000..39d0c132a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2.c.X.original
@@ -0,0 +1,271 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <glxserver.h>
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+
+void __glXDisp_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_Map1d(GLbyte *pc)
+{
+ GLint order, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+ GLdouble u1, u2, *points;
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (order < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDisp_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k;
+#ifdef __GLX_ALIGN64
+ GLint compsize;
+#endif
+ GLenum target;
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+
+#ifdef __GLX_ALIGN64
+ if (vorder < 0 || uorder < 0 || k < 0) {
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+#endif
+
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ pc += 44;
+
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDisp_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+ glCallLists(n, type, pc + 8);
+}
+
+void __glXDisp_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i = 0; i < numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glSecondaryColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_FOG_COORD_ARRAY:
+ glEnableClientState(GL_FOG_COORD_ARRAY);
+ glFogCoordPointer(datatype, stride, pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+ glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glDisableClientState(GL_FOG_COORD_ARRAY);
+}
+
+void __glXDisp_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDisp_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c b/nx-X11/programs/Xserver/GL/glx/render2swap.c
new file mode 100644
index 000000000..0225970cb
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2swap.c
@@ -0,0 +1,393 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "indirect_size.h"
+
+void __glXDispSwap_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 16);
+ __GLX_SWAP_FLOAT(pc + 20);
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_Map1d(GLbyte *pc)
+{
+ GLint order, k, compsize;
+ GLenum target;
+ GLdouble u1, u2, *points;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k, compsize;
+ GLenum target;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_INT(pc + 36);
+ __GLX_SWAP_INT(pc + 40);
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
+ pc += 44;
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ __GLX_SWAP_SHORT_ARRAY(pc+8, n);
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ __GLX_SWAP_INT_ARRAY(pc+8, n);
+ break;
+ case GL_FLOAT:
+ __GLX_SWAP_FLOAT_ARRAY(pc+8, n);
+ break;
+ }
+
+ glCallLists(n, type, pc+8);
+}
+
+static void swapArray(GLint numVals, GLenum datatype,
+ GLint stride, GLint numVertexes, GLbyte *pc)
+{
+ int i,j;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ switch (datatype) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ /* don't need to swap */
+ return;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ for (i=0; i<numVertexes; i++) {
+ GLshort *pVal = (GLshort *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_SHORT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ for (i=0; i<numVertexes; i++) {
+ GLint *pVal = (GLint *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_INT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_FLOAT:
+ for (i=0; i<numVertexes; i++) {
+ GLfloat *pVal = (GLfloat *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_FLOAT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_DOUBLE:
+ for (i=0; i<numVertexes; i++) {
+ GLdouble *pVal = (GLdouble *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_DOUBLE(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ default:
+ return;
+ }
+}
+
+void __glXDispSwap_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&numVertexes);
+ __GLX_SWAP_INT(&numComponents);
+ __GLX_SWAP_INT(&primType);
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ __GLX_SWAP_INT(&datatype);
+ __GLX_SWAP_INT(&numVals);
+ __GLX_SWAP_INT(&component);
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ swapArray(numVals, datatype, stride, numVertexes, pc);
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+}
+
+void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDispSwap_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original b/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original
new file mode 100644
index 000000000..0225970cb
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original
@@ -0,0 +1,393 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+#include "indirect_size.h"
+
+void __glXDispSwap_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 16);
+ __GLX_SWAP_FLOAT(pc + 20);
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_Map1d(GLbyte *pc)
+{
+ GLint order, k, compsize;
+ GLenum target;
+ GLdouble u1, u2, *points;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k, compsize;
+ GLenum target;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_INT(pc + 36);
+ __GLX_SWAP_INT(pc + 40);
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
+ pc += 44;
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ __GLX_SWAP_SHORT_ARRAY(pc+8, n);
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ __GLX_SWAP_INT_ARRAY(pc+8, n);
+ break;
+ case GL_FLOAT:
+ __GLX_SWAP_FLOAT_ARRAY(pc+8, n);
+ break;
+ }
+
+ glCallLists(n, type, pc+8);
+}
+
+static void swapArray(GLint numVals, GLenum datatype,
+ GLint stride, GLint numVertexes, GLbyte *pc)
+{
+ int i,j;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ switch (datatype) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ /* don't need to swap */
+ return;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ for (i=0; i<numVertexes; i++) {
+ GLshort *pVal = (GLshort *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_SHORT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ for (i=0; i<numVertexes; i++) {
+ GLint *pVal = (GLint *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_INT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_FLOAT:
+ for (i=0; i<numVertexes; i++) {
+ GLfloat *pVal = (GLfloat *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_FLOAT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_DOUBLE:
+ for (i=0; i<numVertexes; i++) {
+ GLdouble *pVal = (GLdouble *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_DOUBLE(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ default:
+ return;
+ }
+}
+
+void __glXDispSwap_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&numVertexes);
+ __GLX_SWAP_INT(&numComponents);
+ __GLX_SWAP_INT(&primType);
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ __GLX_SWAP_INT(&datatype);
+ __GLX_SWAP_INT(&numVals);
+ __GLX_SWAP_INT(&component);
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ swapArray(numVals, datatype, stride, numVertexes, pc);
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+}
+
+void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDispSwap_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c.X.original b/nx-X11/programs/Xserver/GL/glx/render2swap.c.X.original
new file mode 100644
index 000000000..65ac5e18a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/render2swap.c.X.original
@@ -0,0 +1,393 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+/* #define NEED_REPLIES */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+
+void __glXDispSwap_Map1f(GLbyte *pc)
+{
+ GLint order, k;
+ GLfloat u1, u2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ points = (GLfloat *)(pc + 16);
+ k = __glMap1f_size(target);
+
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap1f(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2f(GLbyte *pc)
+{
+ GLint uorder, vorder, ustride, vstride, k;
+ GLfloat u1, u2, v1, v2, *points;
+ GLenum target;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 16);
+ __GLX_SWAP_FLOAT(pc + 20);
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ u1 = *(GLfloat *)(pc + 4);
+ u2 = *(GLfloat *)(pc + 8);
+ v1 = *(GLfloat *)(pc + 16);
+ v2 = *(GLfloat *)(pc + 20);
+ points = (GLfloat *)(pc + 28);
+
+ k = __glMap2f_size(target);
+ ustride = vorder * k;
+ vstride = k;
+
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_SWAP_FLOAT_ARRAY(points, compsize);
+
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_Map1d(GLbyte *pc)
+{
+ GLint order, k, compsize;
+ GLenum target;
+ GLdouble u1, u2, *points;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ k = __glMap1d_size(target);
+ if (order <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = order * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
+ pc += 24;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap1d(target, u1, u2, k, order, points);
+}
+
+void __glXDispSwap_Map2d(GLbyte *pc)
+{
+ GLdouble u1, u2, v1, v2, *points;
+ GLint uorder, vorder, ustride, vstride, k, compsize;
+ GLenum target;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_INT(pc + 36);
+ __GLX_SWAP_INT(pc + 40);
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ k = __glMap2d_size(target);
+ if (vorder <= 0 || uorder <= 0 || k < 0) {
+ /* Erroneous command. */
+ compsize = 0;
+ } else {
+ compsize = uorder * vorder * k;
+ }
+ __GLX_GET_DOUBLE(u1,pc);
+ __GLX_GET_DOUBLE(u2,pc+8);
+ __GLX_GET_DOUBLE(v1,pc+16);
+ __GLX_GET_DOUBLE(v2,pc+24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
+ pc += 44;
+ ustride = vorder * k;
+ vstride = k;
+
+#ifdef __GLX_ALIGN64
+ if (((unsigned long)pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc-4, pc, compsize*8);
+ points = (GLdouble*) (pc - 4);
+ } else {
+ points = (GLdouble*) pc;
+ }
+#else
+ points = (GLdouble*) pc;
+#endif
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+void __glXDispSwap_CallLists(GLbyte *pc)
+{
+ GLenum type;
+ GLsizei n;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ type = *(GLenum *)(pc + 4);
+ n = *(GLsizei *)(pc + 0);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ __GLX_SWAP_SHORT_ARRAY(pc+8, n);
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ __GLX_SWAP_INT_ARRAY(pc+8, n);
+ break;
+ case GL_FLOAT:
+ __GLX_SWAP_FLOAT_ARRAY(pc+8, n);
+ break;
+ }
+
+ glCallLists(n, type, pc+8);
+}
+
+static void swapArray(GLint numVals, GLenum datatype,
+ GLint stride, GLint numVertexes, GLbyte *pc)
+{
+ int i,j;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ switch (datatype) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ /* don't need to swap */
+ return;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ for (i=0; i<numVertexes; i++) {
+ GLshort *pVal = (GLshort *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_SHORT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ for (i=0; i<numVertexes; i++) {
+ GLint *pVal = (GLint *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_INT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_FLOAT:
+ for (i=0; i<numVertexes; i++) {
+ GLfloat *pVal = (GLfloat *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_FLOAT(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ case GL_DOUBLE:
+ for (i=0; i<numVertexes; i++) {
+ GLdouble *pVal = (GLdouble *) pc;
+ for (j=0; j<numVals; j++) {
+ __GLX_SWAP_DOUBLE(&pVal[j]);
+ }
+ pc += stride;
+ }
+ break;
+ default:
+ return;
+ }
+}
+
+void __glXDispSwap_DrawArrays(GLbyte *pc)
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLenum primType = hdr->primType;
+ GLint stride = 0;
+ int i;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&numVertexes);
+ __GLX_SWAP_INT(&numComponents);
+ __GLX_SWAP_INT(&primType);
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
+
+ /* compute stride (same for all component arrays) */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ __GLX_SWAP_INT(&datatype);
+ __GLX_SWAP_INT(&numVals);
+ __GLX_SWAP_INT(&component);
+
+ stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
+
+ /* set up component arrays */
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLenum component = compHeader[i].component;
+
+ swapArray(numVals, datatype, stride, numVertexes, pc);
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_NORMAL_ARRAY:
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(datatype, stride, pc);
+ break;
+ case GL_COLOR_ARRAY:
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_INDEX_ARRAY:
+ glEnableClientState(GL_INDEX_ARRAY);
+ glIndexPointer(datatype, stride, pc);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(numVals, datatype, stride, pc);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ glEnableClientState(GL_EDGE_FLAG_ARRAY);
+ glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ break;
+ default:
+ break;
+ }
+
+ pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
+ }
+
+ glDrawArrays(primType, 0, numVertexes);
+
+ /* turn off anything we might have turned on */
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_INDEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_EDGE_FLAG_ARRAY);
+}
+
+void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
+{
+ __glXDispSwap_DrawArrays(pc);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/renderpix.c b/nx-X11/programs/Xserver/GL/glx/renderpix.c
new file mode 100644
index 000000000..fe508e299
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/renderpix.c
@@ -0,0 +1,312 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+void __glXDisp_PolygonStipple(GLbyte *pc)
+{
+ __GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glPolygonStipple((GLubyte *)(hdr+1));
+}
+
+void __glXDisp_Bitmap(GLbyte *pc)
+{
+ __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glBitmap((GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ (GLfloat) hdr->xorig,
+ (GLfloat) hdr->yorig,
+ (GLfloat) hdr->xmove,
+ (GLfloat) hdr->ymove,
+ (GLubyte *)(hdr+1));
+}
+
+void __glXDisp_TexImage1D(GLbyte *pc)
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexImage1D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->components,
+ (GLsizei) hdr->width,
+ (GLint) hdr->border,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_TexImage2D(GLbyte *pc)
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexImage2D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->components,
+ (GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ (GLint) hdr->border,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_TexImage3D(GLbyte *pc)
+{
+ __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
+ hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_DrawPixels(GLbyte *pc)
+{
+ __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glDrawPixels((GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_TexSubImage1D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexSubImage1D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->xoffset,
+ (GLsizei) hdr->width,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_TexSubImage2D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexSubImage2D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->xoffset,
+ (GLint) hdr->yoffset,
+ (GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_TexSubImage3D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImage3DHeader *hdr =
+ (__GLXdispatchTexSubImage3DHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
+ hdr->zoffset, hdr->width, hdr->height, hdr->depth,
+ hdr->format, hdr->type, (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_ColorTable(GLbyte *pc)
+{
+ __GLXdispatchColorTableHeader *hdr =
+ (__GLXdispatchColorTableHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glColorTable(hdr->target, hdr->internalformat,
+ hdr->width, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_ColorSubTable(GLbyte *pc)
+{
+ __GLXdispatchColorSubTableHeader *hdr =
+ (__GLXdispatchColorSubTableHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
+ hdr->type, (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_ConvolutionFilter1D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glConvolutionFilter1D(hdr->target, hdr->internalformat,
+ hdr->width, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_ConvolutionFilter2D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glConvolutionFilter2D(hdr->target, hdr->internalformat,
+ hdr->width, hdr->height, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDisp_SeparableFilter2D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+ GLint hdrlen, image1len;
+
+ hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ /* XXX check this usage - internal code called
+ ** a version without the packing parameters
+ */
+ image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
+ 0, hdr->rowLength, 0, hdr->skipRows,
+ hdr->alignment);
+ image1len = __GLX_PAD(image1len);
+
+ glSeparableFilter2D(hdr->target, hdr->internalformat,
+ hdr->width, hdr->height, hdr->format, hdr->type,
+ ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/renderpixswap.c b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c
new file mode 100644
index 000000000..9c3100fb3
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c
@@ -0,0 +1,555 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+void __glXDispSwap_PolygonStipple(GLbyte *pc)
+{
+ __GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glPolygonStipple((GLubyte *)(hdr+1));
+}
+
+void __glXDispSwap_Bitmap(GLbyte *pc)
+{
+ __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
+ __GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
+ __GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
+ __GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glBitmap((GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ (GLfloat) hdr->xorig,
+ (GLfloat) hdr->yorig,
+ (GLfloat) hdr->xmove,
+ (GLfloat) hdr->ymove,
+ (GLubyte *)(hdr+1));
+}
+
+void __glXDispSwap_TexImage1D(GLbyte *pc)
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->components);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->border);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexImage1D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->components,
+ (GLsizei) hdr->width,
+ (GLint) hdr->border,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_TexImage2D(GLbyte *pc)
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->components);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->border);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexImage2D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->components,
+ (GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ (GLint) hdr->border,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_TexImage3D(GLbyte *pc)
+{
+ __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
+ __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->depth);
+ __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
+ __GLX_SWAP_INT((GLbyte *)&hdr->border);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
+ hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_DrawPixels(GLbyte *pc)
+{
+ __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glDrawPixels((GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_TexSubImage1D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexSubImage1D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->xoffset,
+ (GLsizei) hdr->width,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_TexSubImage2D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+
+ glTexSubImage2D(hdr->target,
+ (GLint) hdr->level,
+ (GLint) hdr->xoffset,
+ (GLint) hdr->yoffset,
+ (GLsizei) hdr->width,
+ (GLsizei) hdr->height,
+ hdr->format,
+ hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_TexSubImage3D(GLbyte *pc)
+{
+ __GLXdispatchTexSubImage3DHeader *hdr =
+ (__GLXdispatchTexSubImage3DHeader *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
+ __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->level);
+ __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->depth);
+ __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
+ hdr->zoffset, hdr->width, hdr->height, hdr->depth,
+ hdr->format, hdr->type, (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_ColorTable(GLbyte *pc)
+{
+ __GLXdispatchColorTableHeader *hdr =
+ (__GLXdispatchColorTableHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glColorTable(hdr->target, hdr->internalformat,
+ hdr->width, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_ColorSubTable(GLbyte *pc)
+{
+ __GLXdispatchColorSubTableHeader *hdr =
+ (__GLXdispatchColorSubTableHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->start);
+ __GLX_SWAP_INT((GLbyte *)&hdr->count);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
+ hdr->type, (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glConvolutionFilter2D(hdr->target, hdr->internalformat,
+ hdr->width, 1, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ glConvolutionFilter2D(hdr->target, hdr->internalformat,
+ hdr->width, hdr->height, hdr->format, hdr->type,
+ (GLvoid *)(hdr+1));
+}
+
+void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+ GLint hdrlen, image1len;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *)&hdr->target);
+ __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *)&hdr->width);
+ __GLX_SWAP_INT((GLbyte *)&hdr->height);
+ __GLX_SWAP_INT((GLbyte *)&hdr->format);
+ __GLX_SWAP_INT((GLbyte *)&hdr->type);
+
+ /*
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+
+ /* XXX check this usage - internal code called
+ ** a version without the packing parameters
+ */
+ image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
+ 0, hdr->rowLength, 0, hdr->skipRows,
+ hdr->alignment);
+ image1len = __GLX_PAD(image1len);
+
+
+ glSeparableFilter2D(hdr->target, hdr->internalformat,
+ hdr->width, hdr->height, hdr->format, hdr->type,
+ ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/rensize.c b/nx-X11/programs/Xserver/GL/glx/rensize.c
new file mode 100644
index 000000000..7ab02d257
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/rensize.c
@@ -0,0 +1,987 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/rensize.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <GL/gl.h>
+#include "glxserver.h"
+#include "GL/glxproto.h"
+#include "unpack.h"
+#include "impsize.h"
+
+#define SWAPL(a) \
+ (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \
+ ((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
+
+int __glXCallListsReqSize(GLbyte *pc, Bool swap )
+{
+ GLsizei n = *(GLsizei *)(pc + 0);
+ GLenum type = *(GLenum *)(pc + 4);
+
+ if (swap) {
+ n = SWAPL( n );
+ type = SWAPL( type );
+ }
+ return n * __glCallLists_size( type );
+}
+
+int __glXFogivReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 0);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glFogiv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXFogfvReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXFogivReqSize( pc, swap );
+}
+
+int __glXLightfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glLightfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXLightivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXLightfvReqSize( pc, swap );
+}
+
+int __glXLightModelfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 0);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glLightModelfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXLightModelivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXLightModelfvReqSize( pc, swap );
+}
+
+int __glXMaterialfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glMaterialfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXMaterialivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXMaterialfvReqSize( pc, swap );
+}
+
+int __glXTexGendvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 8 * __glTexGendv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXTexGenfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glTexGenfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXTexGenivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXTexGenfvReqSize( pc, swap );
+}
+
+int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glTexParameterfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXTexParameterivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXTexParameterfvReqSize( pc, swap );
+}
+
+int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glTexEnvfv_size( pname ); /* defined in samplegl lib */
+}
+
+int __glXTexEnvivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXTexEnvfvReqSize( pc, swap );
+}
+
+static int Map1Size( GLint k, GLint order)
+{
+ if (order <= 0 || k < 0) return -1;
+ return k * order;
+}
+
+int __glXMap1dReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum target;
+ GLint order, k;
+
+ target = *(GLenum*) (pc + 16);
+ order = *(GLint*) (pc + 20);
+ if (swap) {
+ target = SWAPL( target );
+ order = SWAPL( order );
+ }
+ k = __glMap1d_size( target );
+ return 8 * Map1Size( k, order );
+}
+
+int __glXMap1fReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum target;
+ GLint order, k;
+
+ target = *(GLenum *)(pc + 0);
+ order = *(GLint *)(pc + 12);
+ if (swap) {
+ target = SWAPL( target );
+ order = SWAPL( order );
+ }
+ k = __glMap1f_size(target);
+ return 4 * Map1Size(k, order);
+}
+
+static int Map2Size(int k, int majorOrder, int minorOrder)
+{
+ if (majorOrder <= 0 || minorOrder <= 0 || k < 0) return -1;
+ return k * majorOrder * minorOrder;
+}
+
+int __glXMap2dReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum target;
+ GLint uorder, vorder, k;
+
+ target = *(GLenum *)(pc + 32);
+ uorder = *(GLint *)(pc + 36);
+ vorder = *(GLint *)(pc + 40);
+ if (swap) {
+ target = SWAPL( target );
+ uorder = SWAPL( uorder );
+ vorder = SWAPL( vorder );
+ }
+ k = __glMap2d_size( target );
+ return 8 * Map2Size( k, uorder, vorder );
+}
+
+int __glXMap2fReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum target;
+ GLint uorder, vorder, k;
+
+ target = *(GLenum *)(pc + 0);
+ uorder = *(GLint *)(pc + 12);
+ vorder = *(GLint *)(pc + 24);
+ if (swap) {
+ target = SWAPL( target );
+ uorder = SWAPL( uorder );
+ vorder = SWAPL( vorder );
+ }
+ k = __glMap2f_size( target );
+ return 4 * Map2Size( k, uorder, vorder );
+}
+
+int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLint mapsize;
+ mapsize = *(GLint *)(pc + 4);
+ if (swap) {
+ mapsize = SWAPL( mapsize );
+ }
+ return 4 * mapsize;
+}
+
+int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXPixelMapfvReqSize( pc, swap );
+}
+
+int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap )
+{
+ GLint mapsize;
+ mapsize = *(GLint *)(pc + 4);
+ if (swap) {
+ mapsize = SWAPL( mapsize );
+ }
+ return 2 * mapsize;
+}
+
+/**
+ * Calculate the size of an image.
+ *
+ * The size of an image sent to the server from the client or sent from the
+ * server to the client is calculated. The size is based on the dimensions
+ * of the image, the type of pixel data, padding in the image, and the
+ * alignment requirements of the image.
+ *
+ * \param format Format of the pixels. Same as the \c format parameter
+ * to \c glTexImage1D
+ * \param type Type of the pixel data. Same as the \c type parameter
+ * to \c glTexImage1D
+ * \param target Typically the texture target of the image. If the
+ * target is one of \c GL_PROXY_*, the size returned is
+ * always zero. For uses that do not have a texture target
+ * (e.g, glDrawPixels), zero should be specified.
+ * \param w Width of the image data. Must be >= 1.
+ * \param h Height of the image data. Must be >= 1, even for 1D
+ * images.
+ * \param d Depth of the image data. Must be >= 1, even for 1D or
+ * 2D images.
+ * \param imageHeight If non-zero, defines the true height of a volumetric
+ * image. This value will be used instead of \c h for
+ * calculating the size of the image.
+ * \param rowLength If non-zero, defines the true width of an image. This
+ * value will be used instead of \c w for calculating the
+ * size of the image.
+ * \param skipImages Number of extra layers of image data in a volumtric
+ * image that are to be skipped before the real data.
+ * \param skipRows Number of extra rows of image data in an image that are
+ * to be skipped before the real data.
+ * \param alignment Specifies the alignment for the start of each pixel row
+ * in memory. This value must be one of 1, 2, 4, or 8.
+ *
+ * \returns
+ * The size of the image is returned. If the specified \c format and \c type
+ * are invalid, -1 is returned. If \c target is one of \c GL_PROXY_*, zero
+ * is returned.
+ */
+int __glXImageSize( GLenum format, GLenum type, GLenum target,
+ GLsizei w, GLsizei h, GLsizei d,
+ GLint imageHeight, GLint rowLength,
+ GLint skipImages, GLint skipRows, GLint alignment )
+{
+ GLint bytesPerElement, elementsPerGroup, groupsPerRow;
+ GLint groupSize, rowSize, padding, imageSize;
+
+ if (w < 0 || h < 0 || d < 0 ||
+ (type == GL_BITMAP &&
+ (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) {
+ return -1;
+ }
+ if (w==0 || h==0 || d == 0) return 0;
+
+ switch( target ) {
+ case GL_PROXY_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_4D_SGIS:
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_PROXY_TEXTURE_RECTANGLE_ARB:
+ case GL_PROXY_HISTOGRAM:
+ case GL_PROXY_COLOR_TABLE:
+ case GL_PROXY_TEXTURE_COLOR_TABLE_SGI:
+ case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
+ case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
+ case GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP:
+ return 0;
+ }
+
+ if (type == GL_BITMAP) {
+ if (rowLength > 0) {
+ groupsPerRow = rowLength;
+ } else {
+ groupsPerRow = w;
+ }
+ rowSize = (groupsPerRow + 7) >> 3;
+ padding = (rowSize % alignment);
+ if (padding) {
+ rowSize += alignment - padding;
+ }
+ return ((h + skipRows) * rowSize);
+ } else {
+ switch(format) {
+ case GL_COLOR_INDEX:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_COMPONENT:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_INTENSITY:
+ elementsPerGroup = 1;
+ break;
+ case GL_422_EXT:
+ case GL_422_REV_EXT:
+ case GL_422_AVERAGE_EXT:
+ case GL_422_REV_AVERAGE_EXT:
+ case GL_DEPTH_STENCIL_NV:
+ case GL_DEPTH_STENCIL_MESA:
+ case GL_YCBCR_MESA:
+ case GL_LUMINANCE_ALPHA:
+ elementsPerGroup = 2;
+ break;
+ case GL_RGB:
+ case GL_BGR:
+ elementsPerGroup = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ elementsPerGroup = 4;
+ break;
+ default:
+ return -1;
+ }
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ case GL_BYTE:
+ bytesPerElement = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ bytesPerElement = 1;
+ elementsPerGroup = 1;
+ break;
+ case GL_UNSIGNED_SHORT:
+ case GL_SHORT:
+ bytesPerElement = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ case GL_UNSIGNED_SHORT_8_8_APPLE:
+ case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
+ case GL_UNSIGNED_SHORT_15_1_MESA:
+ case GL_UNSIGNED_SHORT_1_15_REV_MESA:
+ bytesPerElement = 2;
+ elementsPerGroup = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ bytesPerElement = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_24_8_NV:
+ case GL_UNSIGNED_INT_24_8_MESA:
+ case GL_UNSIGNED_INT_8_24_REV_MESA:
+ bytesPerElement = 4;
+ elementsPerGroup = 1;
+ break;
+ default:
+ return -1;
+ }
+ groupSize = bytesPerElement * elementsPerGroup;
+ if (rowLength > 0) {
+ groupsPerRow = rowLength;
+ } else {
+ groupsPerRow = w;
+ }
+ rowSize = groupsPerRow * groupSize;
+ padding = (rowSize % alignment);
+ if (padding) {
+ rowSize += alignment - padding;
+ }
+ if (imageHeight > 0) {
+ imageSize = (imageHeight + skipRows) * rowSize;
+ } else {
+ imageSize = (h + skipRows) * rowSize;
+ }
+ return ((d + skipImages) * imageSize);
+ }
+}
+
+
+int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ return __glXImageSize( format, type, 0, w, h, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXBitmapReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ return __glXImageSize( GL_COLOR_INDEX, GL_BITMAP, 0, w, h, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXTexImage1DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+ GLenum target = hdr->target;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ target = SWAPL( target );
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ if (target == GL_PROXY_TEXTURE_1D) {
+ return 0;
+ } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) {
+ return -1;
+ }
+ return __glXImageSize( format, type, 0, w, 1, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXTexImage2DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+ GLenum target = hdr->target;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ target = SWAPL( target );
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
+ return 0;
+ } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) {
+ return -1;
+ }
+ return __glXImageSize( format, type, 0, w, h, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+/* XXX this is used elsewhere - should it be exported from glxserver.h? */
+int __glXTypeSize(GLenum enm)
+{
+ switch(enm) {
+ case GL_BYTE: return sizeof(GLbyte);
+ case GL_UNSIGNED_BYTE: return sizeof(GLubyte);
+ case GL_SHORT: return sizeof(GLshort);
+ case GL_UNSIGNED_SHORT: return sizeof(GLushort);
+ case GL_INT: return sizeof(GLint);
+ case GL_UNSIGNED_INT: return sizeof(GLint);
+ case GL_FLOAT: return sizeof(GLfloat);
+ case GL_DOUBLE: return sizeof(GLdouble);
+ default: return -1;
+ }
+}
+
+int __glXDrawArraysSize( GLbyte *pc, Bool swap )
+{
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
+ __GLXdispatchDrawArraysComponentHeader *compHeader;
+ GLint numVertexes = hdr->numVertexes;
+ GLint numComponents = hdr->numComponents;
+ GLint arrayElementSize = 0;
+ int i;
+
+ if (swap) {
+ numVertexes = SWAPL( numVertexes );
+ numComponents = SWAPL( numComponents );
+ }
+
+ pc += sizeof(__GLXdispatchDrawArraysHeader);
+ compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
+
+ for (i=0; i<numComponents; i++) {
+ GLenum datatype = compHeader[i].datatype;
+ GLint numVals = compHeader[i].numVals;
+ GLint component = compHeader[i].component;
+
+ if (swap) {
+ datatype = SWAPL( datatype );
+ numVals = SWAPL( numVals );
+ component = SWAPL( component );
+ }
+
+ switch (component) {
+ case GL_VERTEX_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_NORMAL_ARRAY:
+ if (numVals != 3) {
+ /* bad size */
+ return -1;
+ }
+ break;
+ case GL_FOG_COORD_ARRAY:
+ case GL_INDEX_ARRAY:
+ if (numVals != 1) {
+ /* bad size */
+ return -1;
+ }
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ if ((numVals != 1) && (datatype != GL_UNSIGNED_BYTE)) {
+ /* bad size or bad type */
+ return -1;
+ }
+ break;
+ default:
+ /* unknown component type */
+ return -1;
+ }
+
+ arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype));
+
+ pc += sizeof(__GLXdispatchDrawArraysComponentHeader);
+ }
+
+ return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) +
+ (numVertexes * arrayElementSize));
+}
+
+int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap )
+{
+ GLint n = *(GLsizei *)(pc + 0);
+ if (swap) n = SWAPL(n);
+ return(8*n); /* 4*n for textures, 4*n for priorities */
+}
+
+int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ return __glXImageSize( format, type, 0, w, 1, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ return __glXImageSize( format, type, 0, w, h, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXTexImage3DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
+ GLenum target = hdr->target;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint d = hdr->depth;
+ GLint imageHeight = hdr->imageHeight;
+ GLint rowLength = hdr->rowLength;
+ GLint skipImages = hdr->skipImages;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+ GLint nullImage = hdr->nullimage;
+
+ if (swap) {
+ target = SWAPL( target );
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ d = SWAPL( d );
+ imageHeight = SWAPL( imageHeight );
+ rowLength = SWAPL( rowLength );
+ skipImages = SWAPL( skipImages );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ if (target == GL_PROXY_TEXTURE_3D || nullImage) {
+ return 0;
+ } else {
+ return __glXImageSize( format, type, target, w, h, d, imageHeight,
+ rowLength, skipImages, skipRows, alignment );
+ }
+}
+
+int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchTexSubImage3DHeader *hdr =
+ (__GLXdispatchTexSubImage3DHeader *) pc;
+ GLenum target = hdr->target;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint d = hdr->depth;
+ GLint imageHeight = hdr->imageHeight;
+ GLint rowLength = hdr->rowLength;
+ GLint skipImages = hdr->skipImages;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ target = SWAPL( target );
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ d = SWAPL( d );
+ imageHeight = SWAPL( imageHeight );
+ rowLength = SWAPL( rowLength );
+ skipImages = SWAPL( skipImages );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+ if (target == GL_PROXY_TEXTURE_3D) {
+ return 0;
+ } else {
+ return __glXImageSize( format, type, target, w, h, d, imageHeight,
+ rowLength, skipImages, skipRows, alignment );
+ }
+}
+
+int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint rowLength = hdr->rowLength;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ rowLength = SWAPL( rowLength );
+ alignment = SWAPL( alignment );
+ }
+
+ return __glXImageSize( format, type, 0, w, 1, 1,
+ 0, rowLength, 0, 0, alignment );
+}
+
+int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint skipRows = hdr->skipRows;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ skipRows = SWAPL( skipRows );
+ alignment = SWAPL( alignment );
+ }
+
+ return __glXImageSize( format, type, 0, w, h, 1,
+ 0, rowLength, 0, skipRows, alignment );
+}
+
+int __glXConvolutionParameterivSize(GLenum pname)
+{
+ switch (pname) {
+ case GL_CONVOLUTION_BORDER_COLOR:
+ case GL_CONVOLUTION_FILTER_SCALE:
+ case GL_CONVOLUTION_FILTER_BIAS:
+ return 4;
+ case GL_CONVOLUTION_BORDER_MODE:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
+int __glXConvolutionParameterfvSize(GLenum pname)
+{
+ return __glXConvolutionParameterivSize(pname);
+}
+
+int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glXConvolutionParameterivSize( pname );
+}
+
+int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap )
+{
+ return __glXConvolutionParameterivReqSize( pc, swap );
+}
+
+int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchConvolutionFilterHeader *hdr =
+ (__GLXdispatchConvolutionFilterHeader *) pc;
+
+ GLint image1size, image2size;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint h = hdr->height;
+ GLint rowLength = hdr->rowLength;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ h = SWAPL( h );
+ rowLength = SWAPL( rowLength );
+ alignment = SWAPL( alignment );
+ }
+
+ /* XXX Should rowLength be used for either or both image? */
+ image1size = __glXImageSize( format, type, 0, w, 1, 1,
+ 0, rowLength, 0, 0, alignment );
+ image1size = __GLX_PAD(image1size);
+ image2size = __glXImageSize( format, type, 0, h, 1, 1,
+ 0, rowLength, 0, 0, alignment );
+ return image1size + image2size;
+
+}
+
+int __glXColorTableParameterfvSize(GLenum pname)
+{
+ /* currently, only scale and bias are supported; return RGBA */
+ switch(pname) {
+ case GL_COLOR_TABLE_SCALE:
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+int __glXColorTableParameterivSize(GLenum pname)
+{
+ /* fv and iv are the same in this context */
+ return __glXColorTableParameterfvSize(pname);
+}
+
+int __glXColorTableReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchColorTableHeader *hdr =
+ (__GLXdispatchColorTableHeader *) pc;
+
+ GLenum target = hdr->target;
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint w = hdr->width;
+ GLint rowLength = hdr->rowLength;
+ GLint alignment = hdr->alignment;
+
+ switch (target) {
+ case GL_PROXY_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_3D:
+ case GL_PROXY_COLOR_TABLE:
+ case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
+ case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ return 0;
+ }
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ w = SWAPL( w );
+ rowLength = SWAPL( rowLength );
+ alignment = SWAPL( alignment );
+ }
+
+ return __glXImageSize( format, type, 0, w, 1, 1,
+ 0, rowLength, 0, 0, alignment );
+}
+
+int __glXColorSubTableReqSize(GLbyte *pc, Bool swap )
+{
+ __GLXdispatchColorSubTableHeader *hdr =
+ (__GLXdispatchColorSubTableHeader *) pc;
+
+ GLenum format = hdr->format;
+ GLenum type = hdr->type;
+ GLint count = hdr->count;
+ GLint rowLength = hdr->rowLength;
+ GLint alignment = hdr->alignment;
+
+ if (swap) {
+ format = SWAPL( format );
+ type = SWAPL( type );
+ count = SWAPL( count );
+ rowLength = SWAPL( rowLength );
+ alignment = SWAPL( alignment );
+ }
+
+ return __glXImageSize( format, type, 0, count, 1, 1,
+ 0, rowLength, 0, 0, alignment );
+}
+
+int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 4);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glXColorTableParameterfvSize(pname);
+}
+
+int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap )
+{
+ /* no difference between fv and iv versions */
+ return __glXColorTableParameterfvReqSize(pc, swap);
+}
+
+int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap )
+{
+ GLenum pname = *(GLenum *)(pc + 0);
+ if (swap) {
+ pname = SWAPL( pname );
+ }
+ return 4 * __glPointParameterfvEXT_size( pname );
+}
+
+int __glXPointParameterivReqSize(GLbyte *pc, Bool swap )
+{
+ /* no difference between fv and iv versions */
+ return __glXPointParameterfvARBReqSize(pc, swap);
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/rensizetab.c b/nx-X11/programs/Xserver/GL/glx/rensizetab.c
new file mode 100644
index 000000000..41656890c
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/rensizetab.c
@@ -0,0 +1,2448 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/rensizetab.c,v 1.5 2004/01/28 18:11:53 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "g_disptab_EXT.h"
+
+__GLXrenderSizeData __glXRenderSizeTable[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ /* no such opcode */ { 0, 0 },
+ /* CallList */ { 8, 0 },
+ /* CallLists */ { 12, __glXCallListsReqSize },
+ /* ListBase */ { 8, 0 },
+ /* Begin */ { 8, 0 },
+ /* Bitmap */ { 48, __glXBitmapReqSize },
+ /* Color3bv */ { 8, 0 },
+ /* Color3dv */ { 28, 0 },
+ /* Color3fv */ { 16, 0 },
+ /* Color3iv */ { 16, 0 },
+ /* Color3sv */ { 12, 0 },
+ /* Color3ubv */ { 8, 0 },
+ /* Color3uiv */ { 16, 0 },
+ /* Color3usv */ { 12, 0 },
+ /* Color4bv */ { 8, 0 },
+ /* Color4dv */ { 36, 0 },
+ /* Color4fv */ { 20, 0 },
+ /* Color4iv */ { 20, 0 },
+ /* Color4sv */ { 12, 0 },
+ /* Color4ubv */ { 8, 0 },
+ /* Color4uiv */ { 20, 0 },
+ /* Color4usv */ { 12, 0 },
+ /* EdgeFlagv */ { 8, 0 },
+ /* End */ { 4, 0 },
+ /* Indexdv */ { 12, 0 },
+ /* Indexfv */ { 8, 0 },
+ /* Indexiv */ { 8, 0 },
+ /* Indexsv */ { 8, 0 },
+ /* Normal3bv */ { 8, 0 },
+ /* Normal3dv */ { 28, 0 },
+ /* Normal3fv */ { 16, 0 },
+ /* Normal3iv */ { 16, 0 },
+ /* Normal3sv */ { 12, 0 },
+ /* RasterPos2dv */ { 20, 0 },
+ /* RasterPos2fv */ { 12, 0 },
+ /* RasterPos2iv */ { 12, 0 },
+ /* RasterPos2sv */ { 8, 0 },
+ /* RasterPos3dv */ { 28, 0 },
+ /* RasterPos3fv */ { 16, 0 },
+ /* RasterPos3iv */ { 16, 0 },
+ /* RasterPos3sv */ { 12, 0 },
+ /* RasterPos4dv */ { 36, 0 },
+ /* RasterPos4fv */ { 20, 0 },
+ /* RasterPos4iv */ { 20, 0 },
+ /* RasterPos4sv */ { 12, 0 },
+ /* Rectdv */ { 36, 0 },
+ /* Rectfv */ { 20, 0 },
+ /* Rectiv */ { 20, 0 },
+ /* Rectsv */ { 12, 0 },
+ /* TexCoord1dv */ { 12, 0 },
+ /* TexCoord1fv */ { 8, 0 },
+ /* TexCoord1iv */ { 8, 0 },
+ /* TexCoord1sv */ { 8, 0 },
+ /* TexCoord2dv */ { 20, 0 },
+ /* TexCoord2fv */ { 12, 0 },
+ /* TexCoord2iv */ { 12, 0 },
+ /* TexCoord2sv */ { 8, 0 },
+ /* TexCoord3dv */ { 28, 0 },
+ /* TexCoord3fv */ { 16, 0 },
+ /* TexCoord3iv */ { 16, 0 },
+ /* TexCoord3sv */ { 12, 0 },
+ /* TexCoord4dv */ { 36, 0 },
+ /* TexCoord4fv */ { 20, 0 },
+ /* TexCoord4iv */ { 20, 0 },
+ /* TexCoord4sv */ { 12, 0 },
+ /* Vertex2dv */ { 20, 0 },
+ /* Vertex2fv */ { 12, 0 },
+ /* Vertex2iv */ { 12, 0 },
+ /* Vertex2sv */ { 8, 0 },
+ /* Vertex3dv */ { 28, 0 },
+ /* Vertex3fv */ { 16, 0 },
+ /* Vertex3iv */ { 16, 0 },
+ /* Vertex3sv */ { 12, 0 },
+ /* Vertex4dv */ { 36, 0 },
+ /* Vertex4fv */ { 20, 0 },
+ /* Vertex4iv */ { 20, 0 },
+ /* Vertex4sv */ { 12, 0 },
+ /* ClipPlane */ { 40, 0 },
+ /* ColorMaterial */ { 12, 0 },
+ /* CullFace */ { 8, 0 },
+ /* Fogf */ { 12, 0 },
+ /* Fogfv */ { 8, __glXFogfvReqSize },
+ /* Fogi */ { 12, 0 },
+ /* Fogiv */ { 8, __glXFogivReqSize },
+ /* FrontFace */ { 8, 0 },
+ /* Hint */ { 12, 0 },
+ /* Lightf */ { 16, 0 },
+ /* Lightfv */ { 12, __glXLightfvReqSize },
+ /* Lighti */ { 16, 0 },
+ /* Lightiv */ { 12, __glXLightivReqSize },
+ /* LightModelf */ { 12, 0 },
+ /* LightModelfv */ { 8, __glXLightModelfvReqSize },
+ /* LightModeli */ { 12, 0 },
+ /* LightModeliv */ { 8, __glXLightModelivReqSize },
+ /* LineStipple */ { 12, 0 },
+ /* LineWidth */ { 8, 0 },
+ /* Materialf */ { 16, 0 },
+ /* Materialfv */ { 12, __glXMaterialfvReqSize },
+ /* Materiali */ { 16, 0 },
+ /* Materialiv */ { 12, __glXMaterialivReqSize },
+ /* PointSize */ { 8, 0 },
+ /* PolygonMode */ { 12, 0 },
+ /* PolygonStipple */ { 152, 0 },
+ /* Scissor */ { 20, 0 },
+ /* ShadeModel */ { 8, 0 },
+ /* TexParameterf */ { 16, 0 },
+ /* TexParameterfv */ { 12, __glXTexParameterfvReqSize },
+ /* TexParameteri */ { 16, 0 },
+ /* TexParameteriv */ { 12, __glXTexParameterivReqSize },
+ /* TexImage1D */ { 56, __glXTexImage1DReqSize },
+ /* TexImage2D */ { 56, __glXTexImage2DReqSize },
+ /* TexEnvf */ { 16, 0 },
+ /* TexEnvfv */ { 12, __glXTexEnvfvReqSize },
+ /* TexEnvi */ { 16, 0 },
+ /* TexEnviv */ { 12, __glXTexEnvivReqSize },
+ /* TexGend */ { 20, 0 },
+ /* TexGendv */ { 12, __glXTexGendvReqSize },
+ /* TexGenf */ { 16, 0 },
+ /* TexGenfv */ { 12, __glXTexGenfvReqSize },
+ /* TexGeni */ { 16, 0 },
+ /* TexGeniv */ { 12, __glXTexGenivReqSize },
+ /* InitNames */ { 4, 0 },
+ /* LoadName */ { 8, 0 },
+ /* PassThrough */ { 8, 0 },
+ /* PopName */ { 4, 0 },
+ /* PushName */ { 8, 0 },
+ /* DrawBuffer */ { 8, 0 },
+ /* Clear */ { 8, 0 },
+ /* ClearAccum */ { 20, 0 },
+ /* ClearIndex */ { 8, 0 },
+ /* ClearColor */ { 20, 0 },
+ /* ClearStencil */ { 8, 0 },
+ /* ClearDepth */ { 12, 0 },
+ /* StencilMask */ { 8, 0 },
+ /* ColorMask */ { 8, 0 },
+ /* DepthMask */ { 8, 0 },
+ /* IndexMask */ { 8, 0 },
+ /* Accum */ { 12, 0 },
+ /* Disable */ { 8, 0 },
+ /* Enable */ { 8, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* PopAttrib */ { 4, 0 },
+ /* PushAttrib */ { 8, 0 },
+ /* Map1d */ { 28, __glXMap1dReqSize },
+ /* Map1f */ { 20, __glXMap1fReqSize },
+ /* Map2d */ { 48, __glXMap2dReqSize },
+ /* Map2f */ { 32, __glXMap2fReqSize },
+ /* MapGrid1d */ { 24, 0 },
+ /* MapGrid1f */ { 16, 0 },
+ /* MapGrid2d */ { 44, 0 },
+ /* MapGrid2f */ { 28, 0 },
+ /* EvalCoord1dv */ { 12, 0 },
+ /* EvalCoord1fv */ { 8, 0 },
+ /* EvalCoord2dv */ { 20, 0 },
+ /* EvalCoord2fv */ { 12, 0 },
+ /* EvalMesh1 */ { 16, 0 },
+ /* EvalPoint1 */ { 8, 0 },
+ /* EvalMesh2 */ { 24, 0 },
+ /* EvalPoint2 */ { 12, 0 },
+ /* AlphaFunc */ { 12, 0 },
+ /* BlendFunc */ { 12, 0 },
+ /* LogicOp */ { 8, 0 },
+ /* StencilFunc */ { 16, 0 },
+ /* StencilOp */ { 16, 0 },
+ /* DepthFunc */ { 8, 0 },
+ /* PixelZoom */ { 12, 0 },
+ /* PixelTransferf */ { 12, 0 },
+ /* PixelTransferi */ { 12, 0 },
+ /* PixelMapfv */ { 12, __glXPixelMapfvReqSize },
+ /* PixelMapuiv */ { 12, __glXPixelMapuivReqSize },
+ /* PixelMapusv */ { 12, __glXPixelMapusvReqSize },
+ /* ReadBuffer */ { 8, 0 },
+ /* CopyPixels */ { 24, 0 },
+ /* DrawPixels */ { 40, __glXDrawPixelsReqSize },
+ /* DepthRange */ { 20, 0 },
+ /* Frustum */ { 52, 0 },
+ /* LoadIdentity */ { 4, 0 },
+ /* LoadMatrixf */ { 68, 0 },
+ /* LoadMatrixd */ { 132, 0 },
+ /* MatrixMode */ { 8, 0 },
+ /* MultMatrixf */ { 68, 0 },
+ /* MultMatrixd */ { 132, 0 },
+ /* Ortho */ { 52, 0 },
+ /* PopMatrix */ { 4, 0 },
+ /* PushMatrix */ { 4, 0 },
+ /* Rotated */ { 36, 0 },
+ /* Rotatef */ { 20, 0 },
+ /* Scaled */ { 28, 0 },
+ /* Scalef */ { 16, 0 },
+ /* Translated */ { 28, 0 },
+ /* Translatef */ { 16, 0 },
+ /* Viewport */ { 20, 0 },
+ /* PolygonOffset */ { 12, 0 },
+ /* DrawArrays */ { 16, __glXDrawArraysSize },
+ /* Indexubv */ { 8, 0 },
+ /* ColorSubTable */ { 44, __glXColorSubTableReqSize },
+ /* CopyColorSubTable */ { 24, 0 },
+ /* ActiveTextureARB */ { 8, 0 },
+ /* MultiTexCoord1dvARB */ { 16, 0 },
+ /* MultiTexCoord1fvARB */ { 12, 0 },
+ /* MultiTexCoord1ivARB */ { 12, 0 },
+ /* MultiTexCoord1svARB */ { 12, 0 },
+ /* MultiTexCoord2dvARB */ { 24, 0 },
+ /* MultiTexCoord2fvARB */ { 16, 0 },
+ /* MultiTexCoord2ivARB */ { 16, 0 },
+ /* MultiTexCoord2svARB */ { 12, 0 },
+ /* MultiTexCoord3dvARB */ { 32, 0 },
+ /* MultiTexCoord3fvARB */ { 20, 0 },
+ /* MultiTexCoord3ivARB */ { 20, 0 },
+ /* MultiTexCoord3svARB */ { 16, 0 },
+ /* MultiTexCoord4dvARB */ { 40, 0 },
+ /* MultiTexCoord4fvARB */ { 24, 0 },
+ /* MultiTexCoord4ivARB */ { 24, 0 },
+ /* MultiTexCoord4svARB 213 */ { 16, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode 220 */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* WindowPos3fARB 230 */ { 16, 0 },
+};
+__GLXrenderSizeData __glXRenderSizeTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
+ /* ColorTable 2053 */ { 44, __glXColorTableReqSize },
+ /* ColorTableParameterfv */ { 12, __glXColorTableParameterfvReqSize },
+ /* ColorTableParameteriv */ { 12, __glXColorTableParameterivReqSize },
+ /* CopyColorTable */ { 24, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* PointParameterfARB 2065 */ { 12, 0 },
+ /* PointParameterfvARB 2066 */ { 8, __glXPointParameterfvARBReqSize },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* BlendColor */ { 20, 0 },
+ /* BlendEquation */ { 8, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* TexSubImage1D */ { 60, __glXTexSubImage1DReqSize },
+ /* TexSubImage2D */ { 60, __glXTexSubImage2DReqSize },
+ /* ConvolutionFilter1D */ { 48, __glXConvolutionFilter1DReqSize },
+ /* ConvolutionFilter2D */ { 48, __glXConvolutionFilter2DReqSize },
+ /* ConvolutionParameterf */ { 16, 0 },
+ /* ConvolutionParameterfv */ { 12, __glXConvolutionParameterfvReqSize },
+ /* ConvolutionParameteri */ { 16, 0 },
+ /* ConvolutionParameteriv */ { 12, __glXConvolutionParameterivReqSize },
+ /* CopyConvolutionFilter1D */ { 24, },
+ /* CopyConvolutionFilter2D */ { 28, },
+ /* SeparableFilter2D */ { 48, __glXSeparableFilter2DReqSize },
+ /* Histogram */ { 20, },
+ /* Minmax */ { 16, },
+ /* ResetHistogram */ { 8, },
+ /* ResetMinmax */ { 8, },
+ /* TexImage3D */ { 84, __glXTexImage3DReqSize },
+ /* TexSubImage3D */ { 92, __glXTexSubImage3DReqSize },
+ /* DrawArrays */ { 16, __glXDrawArraysSize },
+ /* BindTexture */ { 12, 0 },
+ /* PrioritizeTextures */ { 8, __glXPrioritizeTexturesReqSize },
+ /* CopyTexImage1D */ { 32, 0 },
+ /* CopyTexImage2D */ { 36, 0 },
+ /* CopyTexSubImage1D */ { 28, 0 },
+ /* CopyTexSubImage2D */ { 36, 0 },
+ /* CopyTexSubImage3D 4123 */ { 40, 0 },
+ /* FogCoordfv 4124 */ { 8, 0 },
+ /* FogCoorddv 4125 */ { 12, 0 },
+ /* SecondaryColor3bv 4126 */ { 8, 0 },
+ /* SecondaryColor3sv 4127 */ { 12, 0 },
+ /* SecondaryColor3iv 4128 */ { 16, 0 },
+ /* SecondaryColor3fv 4129 */ { 16, 0 },
+ /* SecondaryColor3dv 4130 */ { 28, 0 },
+ /* SecondaryColor3ubv 4131 */ { 8, 0 },
+ /* SecondaryColor3usv 4132 */ { 12, 0 },
+ /* SecondaryColor3uiv 4133 */ { 16, 0 },
+ /* BlendFuncSeparate 4134 */ { 20, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* no such opcode */ { 0, 0 },
+ /* ActiveStencilFaceEXT 4220 */ { 8, 0 },
+ /* PointParameteri 4221 */ { 12, 0 },
+ /* PointParameteriv 4222 */ { 8, __glXPointParameterivReqSize },
+};
diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c
new file mode 100644
index 000000000..9fee5ff49
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/single2.c
@@ -0,0 +1,411 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.8 2004/02/10 22:54:15 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxext.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "GL/glx_ansic.h"
+
+int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei size;
+ GLenum type;
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ size = *(GLsizei *)(pc+0);
+ type = *(GLenum *)(pc+4);
+ if (cx->feedbackBufSize < size) {
+ cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
+ (size_t)size
+ * __GLX_SIZE_FLOAT32);
+ if (!cx->feedbackBuf) {
+ cl->client->errorValue = size;
+ return BadAlloc;
+ }
+ cx->feedbackBufSize = size;
+ }
+ glFeedbackBuffer(size, type, cx->feedbackBuf);
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ GLsizei size;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ size = *(GLsizei *)(pc+0);
+ if (cx->selectBufSize < size) {
+ cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
+ (size_t) size
+ * __GLX_SIZE_CARD32);
+ if (!cx->selectBuf) {
+ cl->client->errorValue = size;
+ return BadAlloc;
+ }
+ cx->selectBufSize = size;
+ }
+ glSelectBuffer(size, cx->selectBuf);
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client;
+ xGLXRenderModeReply reply;
+ __GLXcontext *cx;
+ GLint nitems=0, retBytes=0, retval, newModeCheck;
+ GLubyte *retBuffer = NULL;
+ GLenum newMode;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ newMode = *(GLenum*) pc;
+ retval = glRenderMode(newMode);
+
+ /* Check that render mode worked */
+ glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
+ if (newModeCheck != newMode) {
+ /* Render mode change failed. Bail */
+ newMode = newModeCheck;
+ goto noChangeAllowed;
+ }
+
+ /*
+ ** Render mode might have still failed if we get here. But in this
+ ** case we can't really tell, nor does it matter. If it did fail, it
+ ** will return 0, and thus we won't send any data across the wire.
+ */
+
+ switch (cx->renderMode) {
+ case GL_RENDER:
+ cx->renderMode = newMode;
+ break;
+ case GL_FEEDBACK:
+ if (retval < 0) {
+ /* Overflow happened. Copy the entire buffer */
+ nitems = cx->feedbackBufSize;
+ } else {
+ nitems = retval;
+ }
+ retBytes = nitems * __GLX_SIZE_FLOAT32;
+ retBuffer = (GLubyte*) cx->feedbackBuf;
+ cx->renderMode = newMode;
+ break;
+ case GL_SELECT:
+ if (retval < 0) {
+ /* Overflow happened. Copy the entire buffer */
+ nitems = cx->selectBufSize;
+ } else {
+ GLuint *bp = cx->selectBuf;
+ GLint i;
+
+ /*
+ ** Figure out how many bytes of data need to be sent. Parse
+ ** the selection buffer to determine this fact as the
+ ** return value is the number of hits, not the number of
+ ** items in the buffer.
+ */
+ nitems = 0;
+ i = retval;
+ while (--i >= 0) {
+ GLuint n;
+
+ /* Parse select data for this hit */
+ n = *bp;
+ bp += 3 + n;
+ }
+ nitems = bp - cx->selectBuf;
+ }
+ retBytes = nitems * __GLX_SIZE_CARD32;
+ retBuffer = (GLubyte*) cx->selectBuf;
+ cx->renderMode = newMode;
+ break;
+ }
+
+ /*
+ ** First reply is the number of elements returned in the feedback or
+ ** selection array, as per the API for glRenderMode itself.
+ */
+ noChangeAllowed:;
+ client = cl->client;
+ reply.length = nitems;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.retval = retval;
+ reply.size = nitems;
+ reply.newMode = newMode;
+ WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
+ if (retBytes) {
+ WriteToClient(client, retBytes, (char *)retBuffer);
+ }
+ return Success;
+}
+
+int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ glFlush();
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ ClientPtr client;
+ int error;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ /* Do a local glFinish */
+ glFinish();
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+
+ /* Send empty reply packet to indicate finish is finished */
+ client = cl->client;
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ return Success;
+}
+
+#define SEPARATOR " "
+
+char *__glXcombine_strings(const char *cext_string, const char *sext_string)
+{
+ size_t clen, slen;
+ char *combo_string, *token, *s1;
+ const char *s2, *end;
+
+ /* safeguard to prevent potentially fatal errors in the string functions */
+ if (!cext_string)
+ cext_string = "";
+ if (!sext_string)
+ sext_string = "";
+
+ /*
+ ** String can't be longer than min(cstring, sstring)
+ ** pull tokens out of shortest string
+ ** include space in combo_string for final separator and null terminator
+ */
+ if ( (clen = __glXStrlen(cext_string)) > (slen = __glXStrlen(sext_string)) ) {
+ combo_string = (char *) __glXMalloc(slen + 2);
+ s1 = (char *) __glXMalloc(slen + 2); __glXStrcpy(s1, sext_string);
+ s2 = cext_string;
+ } else {
+ combo_string = (char *) __glXMalloc(clen + 2);
+ s1 = (char *) __glXMalloc(clen + 2); __glXStrcpy(s1, cext_string);
+ s2 = sext_string;
+ }
+ if (!combo_string || !s1) {
+ if (combo_string) __glXFree(combo_string);
+ if (s1) __glXFree(s1);
+ return NULL;
+ }
+ combo_string[0] = '\0';
+
+ /* Get first extension token */
+ token = __glXStrtok( s1, SEPARATOR);
+ while ( token != NULL ) {
+
+ /*
+ ** if token in second string then save it
+ ** beware of extension names which are prefixes of other extension names
+ */
+ const char *p = s2;
+ end = p + __glXStrlen(p);
+ while (p < end) {
+ size_t n = __glXStrcspn(p, SEPARATOR);
+ if ((__glXStrlen(token) == n) && (__glXStrncmp(token, p, n) == 0)) {
+ combo_string = __glXStrcat( combo_string, token);
+ combo_string = __glXStrcat( combo_string, SEPARATOR);
+ }
+ p += (n + 1);
+ }
+
+ /* Get next extension token */
+ token = __glXStrtok( NULL, SEPARATOR);
+ }
+ __glXFree(s1);
+ return combo_string;
+}
+
+int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
+{
+ ClientPtr client;
+ __GLXcontext *cx;
+ GLenum name;
+ const char *string;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ int error;
+ char *buf = NULL, *buf1 = NULL;
+ GLint length = 0;
+
+ /* If the client has the opposite byte order, swap the contextTag and
+ * the name.
+ */
+ if ( need_swap ) {
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + __GLX_SINGLE_HDR_SIZE);
+ }
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ name = *(GLenum *)(pc + 0);
+ string = (const char *)glGetString(name);
+ client = cl->client;
+
+ /*
+ ** Restrict extensions to those that are supported by both the
+ ** implementation and the connection. That is, return the
+ ** intersection of client, server, and core extension strings.
+ */
+ if (name == GL_EXTENSIONS) {
+ buf1 = __glXcombine_strings(string,
+ cl->GLClientextensions);
+ buf = __glXcombine_strings(buf1,
+ cx->pGlxScreen->GLextensions);
+ if (buf1 != NULL) {
+ __glXFree(buf1);
+ }
+ string = buf;
+ }
+ else if ( name == GL_VERSION ) {
+ if ( atof( string ) > atof( GLServerVersion ) ) {
+ buf = __glXMalloc( __glXStrlen( string )
+ + __glXStrlen( GLServerVersion )
+ + 4 );
+ if ( buf == NULL ) {
+ string = GLServerVersion;
+ }
+ else {
+ __glXSprintf( buf, "%s (%s)", GLServerVersion, string );
+ string = buf;
+ }
+ }
+ }
+ if (string) {
+ length = __glXStrlen((const char *) string) + 1;
+ }
+
+ __GLX_BEGIN_REPLY(length);
+ __GLX_PUT_SIZE(length);
+
+ if ( need_swap ) {
+ __GLX_SWAP_REPLY_SIZE();
+ __GLX_SWAP_REPLY_HEADER();
+ }
+
+ __GLX_SEND_HEADER();
+ WriteToClient(client, length, (char *) string);
+ if (buf != NULL) {
+ __glXFree(buf);
+ }
+ return Success;
+}
+
+int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc)
+{
+ return DoGetString(cl, pc, GL_FALSE);
+}
+
+int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answer[4];
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+
+ __glXClearErrorOccured();
+ glGetClipPlane(*(GLenum *)(pc + 0), answer);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(32);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(4);
+ }
+ return Success;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c
new file mode 100644
index 000000000..dab98ade9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c
@@ -0,0 +1,303 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxext.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "GL/glx_ansic.h"
+
+int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei size;
+ GLenum type;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLXcontext *cx;
+ int error;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ size = *(GLsizei *)(pc+0);
+ type = *(GLenum *)(pc+4);
+ if (cx->feedbackBufSize < size) {
+ cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
+ (size_t) size
+ * __GLX_SIZE_FLOAT32);
+ if (!cx->feedbackBuf) {
+ cl->client->errorValue = size;
+ return BadAlloc;
+ }
+ cx->feedbackBufSize = size;
+ }
+ glFeedbackBuffer(size, type, cx->feedbackBuf);
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ GLsizei size;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ int error;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ size = *(GLsizei *)(pc+0);
+ if (cx->selectBufSize < size) {
+ cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
+ (size_t) size
+ * __GLX_SIZE_CARD32);
+ if (!cx->selectBuf) {
+ cl->client->errorValue = size;
+ return BadAlloc;
+ }
+ cx->selectBufSize = size;
+ }
+ glSelectBuffer(size, cx->selectBuf);
+ __GLX_NOTE_UNFLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client;
+ __GLXcontext *cx;
+ xGLXRenderModeReply reply;
+ GLint nitems=0, retBytes=0, retval, newModeCheck;
+ GLubyte *retBuffer = NULL;
+ GLenum newMode;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ int error;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc);
+ newMode = *(GLenum*) pc;
+ retval = glRenderMode(newMode);
+
+ /* Check that render mode worked */
+ glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
+ if (newModeCheck != newMode) {
+ /* Render mode change failed. Bail */
+ newMode = newModeCheck;
+ goto noChangeAllowed;
+ }
+
+ /*
+ ** Render mode might have still failed if we get here. But in this
+ ** case we can't really tell, nor does it matter. If it did fail, it
+ ** will return 0, and thus we won't send any data across the wire.
+ */
+
+ switch (cx->renderMode) {
+ case GL_RENDER:
+ cx->renderMode = newMode;
+ break;
+ case GL_FEEDBACK:
+ if (retval < 0) {
+ /* Overflow happened. Copy the entire buffer */
+ nitems = cx->feedbackBufSize;
+ } else {
+ nitems = retval;
+ }
+ retBytes = nitems * __GLX_SIZE_FLOAT32;
+ retBuffer = (GLubyte*) cx->feedbackBuf;
+ __GLX_SWAP_FLOAT_ARRAY((GLbyte *)retBuffer, nitems);
+ cx->renderMode = newMode;
+ break;
+ case GL_SELECT:
+ if (retval < 0) {
+ /* Overflow happened. Copy the entire buffer */
+ nitems = cx->selectBufSize;
+ } else {
+ GLuint *bp = cx->selectBuf;
+ GLint i;
+
+ /*
+ ** Figure out how many bytes of data need to be sent. Parse
+ ** the selection buffer to determine this fact as the
+ ** return value is the number of hits, not the number of
+ ** items in the buffer.
+ */
+ nitems = 0;
+ i = retval;
+ while (--i >= 0) {
+ GLuint n;
+
+ /* Parse select data for this hit */
+ n = *bp;
+ bp += 3 + n;
+ }
+ nitems = bp - cx->selectBuf;
+ }
+ retBytes = nitems * __GLX_SIZE_CARD32;
+ retBuffer = (GLubyte*) cx->selectBuf;
+ __GLX_SWAP_INT_ARRAY((GLbyte *)retBuffer, nitems);
+ cx->renderMode = newMode;
+ break;
+ }
+
+ /*
+ ** First reply is the number of elements returned in the feedback or
+ ** selection array, as per the API for glRenderMode itself.
+ */
+ noChangeAllowed:;
+ client = cl->client;
+ reply.length = nitems;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.retval = retval;
+ reply.size = nitems;
+ reply.newMode = newMode;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.retval);
+ __GLX_SWAP_INT(&reply.size);
+ __GLX_SWAP_INT(&reply.newMode);
+ WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
+ if (retBytes) {
+ WriteToClient(client, retBytes, (char *)retBuffer);
+ }
+ return Success;
+}
+
+int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ glFlush();
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+ return Success;
+}
+
+int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ ClientPtr client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ /* Do a local glFinish */
+ glFinish();
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+
+ /* Send empty reply packet to indicate finish is finished */
+ client = cl->client;
+ __GLX_BEGIN_REPLY(0);
+ __GLX_PUT_RETVAL(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+
+ return Success;
+}
+
+int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc)
+{
+ return DoGetString(cl, pc, GL_TRUE);
+}
+
+int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
+{
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLdouble answer[4];
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc + 0);
+
+ __glXClearErrorOccured();
+ glGetClipPlane(*(GLenum *)(pc + 0), answer);
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_SWAP_DOUBLE_ARRAY((GLbyte *)answer, 4);
+ __GLX_BEGIN_REPLY(32);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_DOUBLE_ARRAY(4);
+ }
+ return Success;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/singlepix.c b/nx-X11/programs/Xserver/GL/glx/singlepix.c
new file mode 100644
index 000000000..845c46a64
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/singlepix.c
@@ -0,0 +1,462 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "singlesize.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei width, height;
+ GLenum format, type;
+ GLboolean swapBytes, lsbFirst;
+ GLint compsize;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ width = *(GLsizei *)(pc + 8);
+ height = *(GLsizei *)(pc + 12);
+ format = *(GLenum *)(pc + 16);
+ type = *(GLenum *)(pc + 20);
+ swapBytes = *(GLboolean *)(pc + 24);
+ lsbFirst = *(GLboolean *)(pc + 25);
+ compsize = __glReadPixels_size(format,type,width,height);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glReadPixels(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12),
+ *(GLenum *)(pc + 16),
+ *(GLenum *)(pc + 20),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint level, compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0, depth=1;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ level = *(GLint *)(pc + 4);
+ format = *(GLenum *)(pc + 8);
+ type = *(GLenum *)(pc + 12);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 16);
+
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
+ if ( target == GL_TEXTURE_3D) {
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
+ }
+ /*
+ * The three queries above might fail if we're in a state where queries
+ * are illegal, but then width, height, and depth would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetTexImage(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLenum *)(pc + 12),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetTexImageReply *)&__glXReply)->width = width;
+ ((xGLXGetTexImageReply *)&__glXReply)->height = height;
+ ((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDisp_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean lsbFirst;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLubyte answerBuffer[200];
+ char *answer;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ lsbFirst = *(GLboolean *)(pc + 0);
+
+ glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
+
+ __glXClearErrorOccured();
+ glGetPolygonStipple(
+ (GLubyte *) answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(128);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(128);
+ }
+ return Success;
+}
+
+int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize, compsize2;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ /* target must be SEPARABLE_2D, however I guess we can let the GL
+ barf on this one.... */
+
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+ /*
+ * The two queries above might fail if we're in a state where queries
+ * are illegal, but then width and height would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
+
+ if (compsize < 0) compsize = 0;
+ if (compsize2 < 0) compsize2 = 0;
+ compsize = __GLX_PAD(compsize);
+ compsize2 = __GLX_PAD(compsize2);
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
+ __glXClearErrorOccured();
+ glGetSeparableFilter(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer,
+ answer + compsize,
+ NULL
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize + compsize2);
+ ((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
+ ((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize + compsize2);
+ }
+
+ return Success;
+}
+
+int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+ if (target == GL_CONVOLUTION_1D) {
+ height = 1;
+ } else {
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+ }
+ /*
+ * The two queries above might fail if we're in a state where queries
+ * are illegal, but then width and height would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetConvolutionFilter(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
+ ((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes, reset;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+ reset = *(GLboolean *)(pc + 13);
+
+ glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
+ /*
+ * The one query above might fail if we're in a state where queries
+ * are illegal, but then width would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetHistogram( target, reset, format, type, answer);
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetHistogramReply *)&__glXReply)->width = width;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes, reset;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+ reset = *(GLboolean *)(pc + 13);
+
+ compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetMinmax( target, reset, format, type, answer);
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ target = *(GLenum *)(pc + 0);
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
+ /*
+ * The one query above might fail if we're in a state where queries
+ * are illegal, but then width would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetColorTable(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetColorTableReply *)&__glXReply)->width = width;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c
new file mode 100644
index 000000000..ff68ecedf
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c
@@ -0,0 +1,518 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/singlepixswap.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "singlesize.h"
+#include "unpack.h"
+#include "g_disptab.h"
+#include "g_disptab_EXT.h"
+
+int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
+{
+ GLsizei width, height;
+ GLenum format, type;
+ GLboolean swapBytes, lsbFirst;
+ GLint compsize;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+ __GLX_SWAP_INT(pc+12);
+ __GLX_SWAP_INT(pc+16);
+ __GLX_SWAP_INT(pc+20);
+
+ width = *(GLsizei *)(pc + 8);
+ height = *(GLsizei *)(pc + 12);
+ format = *(GLenum *)(pc + 16);
+ type = *(GLenum *)(pc + 20);
+ swapBytes = *(GLboolean *)(pc + 24);
+ lsbFirst = *(GLboolean *)(pc + 25);
+ compsize = __glReadPixels_size(format,type,width,height);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glReadPixels(
+ *(GLint *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLsizei *)(pc + 8),
+ *(GLsizei *)(pc + 12),
+ *(GLenum *)(pc + 16),
+ *(GLenum *)(pc + 20),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint level, compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0, depth=1;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+ __GLX_SWAP_INT(pc+12);
+
+ level = *(GLint *)(pc + 4);
+ format = *(GLenum *)(pc + 8);
+ type = *(GLenum *)(pc + 12);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 16);
+
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
+ if ( target == GL_TEXTURE_3D) {
+ glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
+ }
+ /*
+ * The three queries above might fail if we're in a state where queries
+ * are illegal, but then width, height, and depth would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetTexImage(
+ *(GLenum *)(pc + 0),
+ *(GLint *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ *(GLenum *)(pc + 12),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SWAP_INT(&width);
+ __GLX_SWAP_INT(&height);
+ __GLX_SWAP_INT(&depth);
+ ((xGLXGetTexImageReply *)&__glXReply)->width = width;
+ ((xGLXGetTexImageReply *)&__glXReply)->height = height;
+ ((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
+{
+ GLboolean lsbFirst;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ GLubyte answerBuffer[200];
+ char *answer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+ pc += __GLX_SINGLE_HDR_SIZE;
+ lsbFirst = *(GLboolean *)(pc + 0);
+
+ glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
+
+ __glXClearErrorOccured();
+ glGetPolygonStipple(
+ (GLubyte *) answer
+ );
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(128);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_HEADER();
+ __GLX_SEND_BYTE_ARRAY(128);
+ }
+ return Success;
+}
+
+int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize, compsize2;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ /* target must be SEPARABLE_2D, however I guess we can let the GL
+ barf on this one.... */
+
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+ /*
+ * The two queries above might fail if we're in a state where queries
+ * are illegal, but then width and height would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
+
+ if (compsize < 0) compsize = 0;
+ if (compsize2 < 0) compsize2 = 0;
+ compsize = __GLX_PAD(compsize);
+ compsize2 = __GLX_PAD(compsize2);
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
+ __glXClearErrorOccured();
+ glGetSeparableFilter(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer,
+ answer + compsize,
+ NULL
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize + compsize2);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SWAP_INT(&width);
+ __GLX_SWAP_INT(&height);
+ ((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
+ ((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
+ __GLX_SEND_VOID_ARRAY(compsize + compsize2);
+ }
+
+ return Success;
+}
+
+int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ char *answer, answerBuffer[200];
+ GLint width=0, height=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+ if (target == GL_CONVOLUTION_2D) {
+ height = 1;
+ } else {
+ glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+ }
+ /*
+ * The two queries above might fail if we're in a state where queries
+ * are illegal, but then width and height would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetConvolutionFilter(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SWAP_INT(&width);
+ __GLX_SWAP_INT(&height);
+ ((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
+ ((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes, reset;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ char *answer, answerBuffer[200];
+ GLint width=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+ reset = *(GLboolean *)(pc + 13);
+
+ glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
+ /*
+ * The one query above might fail if we're in a state where queries
+ * are illegal, but then width would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetHistogram( target, reset, format, type, answer);
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SWAP_INT(&width);
+ ((xGLXGetHistogramReply *)&__glXReply)->width = width;
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes, reset;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ char *answer, answerBuffer[200];
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+ reset = *(GLboolean *)(pc + 13);
+
+ compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetMinmax( target, reset, format, type, answer);
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
+
+int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
+{
+ GLint compsize;
+ GLenum format, type, target;
+ GLboolean swapBytes;
+ __GLXcontext *cx;
+ ClientPtr client = cl->client;
+ int error;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ char *answer, answerBuffer[200];
+ GLint width=0;
+
+ cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
+ if (!cx) {
+ return error;
+ }
+
+ pc += __GLX_SINGLE_HDR_SIZE;
+ __GLX_SWAP_INT(pc+0);
+ __GLX_SWAP_INT(pc+4);
+ __GLX_SWAP_INT(pc+8);
+
+ format = *(GLenum *)(pc + 4);
+ type = *(GLenum *)(pc + 8);
+ target = *(GLenum *)(pc + 0);
+ swapBytes = *(GLboolean *)(pc + 12);
+
+ glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
+ /*
+ * The one query above might fail if we're in a state where queries
+ * are illegal, but then width would still be zero anyway.
+ */
+ compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
+ if (compsize < 0) compsize = 0;
+
+ glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+ __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+ __glXClearErrorOccured();
+ glGetColorTable(
+ *(GLenum *)(pc + 0),
+ *(GLenum *)(pc + 4),
+ *(GLenum *)(pc + 8),
+ answer
+ );
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SWAP_REPLY_HEADER();
+ } else {
+ __GLX_BEGIN_REPLY(compsize);
+ __GLX_SWAP_REPLY_HEADER();
+ __GLX_SWAP_INT(&width);
+ ((xGLXGetColorTableReply *)&__glXReply)->width = width;
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ return Success;
+}
diff --git a/nx-X11/programs/Xserver/GL/glx/singlesize.c b/nx-X11/programs/Xserver/GL/glx/singlesize.c
new file mode 100644
index 000000000..7ed5fe3ef
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/singlesize.c
@@ -0,0 +1,1222 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.c,v 1.7tsi Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <GL/gl.h>
+#include "glxserver.h"
+#include "singlesize.h"
+
+/*
+** These routines compute the size of variable-size returned parameters.
+** Unlike the similar routines that do the same thing for variable-size
+** incoming parameters, the samplegl library itself doesn't use these routines.
+** Hence, they are located here, in the GLX extension library.
+*/
+
+GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h)
+{
+ return __glXImageSize( format, type, 0, w, h, 1, 0, 0, 0, 0, 4 );
+}
+
+/**
+ * Determine the number of data elements that go with the specified \c pname
+ * to a \c glGetTexEnvfv or \c glGetTexEnviv call.
+ *
+ * \todo
+ * Replace this function with a call to \c __glTexEnvfv_size. Make that there
+ * aren't any values of \c pname that are valid for one but not the other.
+ */
+GLint __glGetTexEnvfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_ENV_MODE:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_COMBINE_RGB:
+ case GL_COMBINE_ALPHA:
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_RGB_SCALE:
+ case GL_ALPHA_SCALE:
+
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ case GL_COORD_REPLACE_ARB:
+
+ /* GL_NV_texture_env_combine4 */
+ case GL_SOURCE3_RGB_NV:
+ case GL_SOURCE3_ALPHA_NV:
+ case GL_OPERAND3_RGB_NV:
+ case GL_OPERAND3_ALPHA_NV:
+ return 1;
+
+ case GL_TEXTURE_ENV_COLOR:
+ return 4;
+ default:
+ return -1;
+ }
+}
+
+
+GLint __glGetTexEnviv_size(GLenum pname)
+{
+ return __glGetTexEnvfv_size(pname);
+}
+
+GLint __glGetTexGenfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_GEN_MODE:
+ return 1;
+ case GL_OBJECT_PLANE:
+ return 4;
+ case GL_EYE_PLANE:
+ return 4;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetTexGendv_size(GLenum pname)
+{
+ return __glGetTexGenfv_size(pname);
+}
+
+GLint __glGetTexGeniv_size(GLenum pname)
+{
+ return __glGetTexGenfv_size(pname);
+}
+
+GLint __glGetTexParameterfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ return 4;
+
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_RESIDENT:
+
+ /* GL_SGIS_texture_lod / GL_EXT_texture_lod / GL 1.2 */
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+
+ /* GL_SGIX_texture_lod_bias */
+ case GL_TEXTURE_LOD_BIAS_S_SGIX:
+ case GL_TEXTURE_LOD_BIAS_T_SGIX:
+ case GL_TEXTURE_LOD_BIAS_R_SGIX:
+
+ /* GL_ARB_shadow / GL 1.4 */
+ case GL_TEXTURE_COMPARE_MODE:
+ case GL_TEXTURE_COMPARE_FUNC:
+
+ /* GL_SGIS_generate_mipmap / GL 1.4 */
+ case GL_GENERATE_MIPMAP:
+
+ /* GL_ARB_depth_texture / GL 1.4 */
+ case GL_DEPTH_TEXTURE_MODE:
+
+ /* GL_EXT_texture_lod_bias / GL 1.4 */
+ case GL_TEXTURE_LOD_BIAS:
+
+ /* GL_SGIX_shadow_ambient / GL_ARB_shadow_ambient */
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+
+ /* GL_SGIX_shadow */
+ case GL_TEXTURE_COMPARE_SGIX:
+ case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
+
+ /* GL_SGIX_texture_coordinate_clamp */
+ case GL_TEXTURE_MAX_CLAMP_S_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_T_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_R_SGIX:
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+
+ /* GL_NV_texture_expand_normal */
+ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
+ return 1;
+
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetTexParameteriv_size(GLenum pname)
+{
+ return __glGetTexParameterfv_size(pname);
+}
+
+GLint __glGetLightfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_AMBIENT:
+ return 4;
+ case GL_DIFFUSE:
+ return 4;
+ case GL_SPECULAR:
+ return 4;
+ case GL_POSITION:
+ return 4;
+ case GL_SPOT_DIRECTION:
+ return 3;
+ case GL_SPOT_EXPONENT:
+ return 1;
+ case GL_SPOT_CUTOFF:
+ return 1;
+ case GL_CONSTANT_ATTENUATION:
+ return 1;
+ case GL_LINEAR_ATTENUATION:
+ return 1;
+ case GL_QUADRATIC_ATTENUATION:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetLightiv_size(GLenum pname)
+{
+ return __glGetLightfv_size(pname);
+}
+
+GLint __glGetMap_size(GLenum target, GLenum query)
+{
+ GLint k, order=0, majorMinor[2];
+
+ /*
+ ** Assume target and query are both valid.
+ */
+ switch (target) {
+ case GL_MAP1_COLOR_4:
+ case GL_MAP1_NORMAL:
+ case GL_MAP1_INDEX:
+ case GL_MAP1_TEXTURE_COORD_1:
+ case GL_MAP1_TEXTURE_COORD_2:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_MAP1_VERTEX_3:
+ case GL_MAP1_VERTEX_4:
+ switch (query) {
+ case GL_COEFF:
+ k = __glMap1d_size(target);
+ glGetMapiv(target, GL_ORDER, &order);
+ /*
+ ** The query above might fail, but then order will be zero anyway.
+ */
+ return (order * k);
+ case GL_DOMAIN:
+ return 2;
+ case GL_ORDER:
+ return 1;
+ }
+ break;
+ case GL_MAP2_COLOR_4:
+ case GL_MAP2_NORMAL:
+ case GL_MAP2_INDEX:
+ case GL_MAP2_TEXTURE_COORD_1:
+ case GL_MAP2_TEXTURE_COORD_2:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_MAP2_VERTEX_3:
+ case GL_MAP2_VERTEX_4:
+ switch (query) {
+ case GL_COEFF:
+ k = __glMap2d_size(target);
+ majorMinor[0] = majorMinor[1] = 0;
+ glGetMapiv(target, GL_ORDER, majorMinor);
+ /*
+ ** The query above might fail, but then majorMinor will be zeroes
+ */
+ return (majorMinor[0] * majorMinor[1] * k);
+ case GL_DOMAIN:
+ return 4;
+ case GL_ORDER:
+ return 2;
+ }
+ break;
+ }
+ return -1;
+}
+
+GLint __glGetMapdv_size(GLenum target, GLenum query)
+{
+ return __glGetMap_size(target, query);
+}
+
+GLint __glGetMapfv_size(GLenum target, GLenum query)
+{
+ return __glGetMap_size(target, query);
+}
+
+GLint __glGetMapiv_size(GLenum target, GLenum query)
+{
+ return __glGetMap_size(target, query);
+}
+
+GLint __glGetMaterialfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_SHININESS:
+ return 1;
+ case GL_COLOR_INDEXES:
+ return 3;
+ case GL_EMISSION:
+ return 4;
+ case GL_AMBIENT:
+ return 4;
+ case GL_DIFFUSE:
+ return 4;
+ case GL_SPECULAR:
+ return 4;
+ case GL_AMBIENT_AND_DIFFUSE:
+ return 4;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetMaterialiv_size(GLenum pname)
+{
+ return __glGetMaterialfv_size(pname);
+}
+
+GLint __glGetPixelMap_size(GLenum map)
+{
+ GLint size;
+ GLenum query;
+
+ switch (map) {
+ case GL_PIXEL_MAP_I_TO_I:
+ query = GL_PIXEL_MAP_I_TO_I_SIZE;
+ break;
+ case GL_PIXEL_MAP_S_TO_S:
+ query = GL_PIXEL_MAP_S_TO_S_SIZE;
+ break;
+ case GL_PIXEL_MAP_I_TO_R:
+ query = GL_PIXEL_MAP_I_TO_R_SIZE;
+ break;
+ case GL_PIXEL_MAP_I_TO_G:
+ query = GL_PIXEL_MAP_I_TO_G_SIZE;
+ break;
+ case GL_PIXEL_MAP_I_TO_B:
+ query = GL_PIXEL_MAP_I_TO_B_SIZE;
+ break;
+ case GL_PIXEL_MAP_I_TO_A:
+ query = GL_PIXEL_MAP_I_TO_A_SIZE;
+ break;
+ case GL_PIXEL_MAP_R_TO_R:
+ query = GL_PIXEL_MAP_R_TO_R_SIZE;
+ break;
+ case GL_PIXEL_MAP_G_TO_G:
+ query = GL_PIXEL_MAP_G_TO_G_SIZE;
+ break;
+ case GL_PIXEL_MAP_B_TO_B:
+ query = GL_PIXEL_MAP_B_TO_B_SIZE;
+ break;
+ case GL_PIXEL_MAP_A_TO_A:
+ query = GL_PIXEL_MAP_A_TO_A_SIZE;
+ break;
+ default:
+ return -1;
+ }
+ glGetIntegerv(query, &size);
+ return size;
+}
+
+GLint __glGetPixelMapfv_size(GLenum map)
+{
+ return __glGetPixelMap_size(map);
+}
+
+GLint __glGetPixelMapuiv_size(GLenum map)
+{
+ return __glGetPixelMap_size(map);
+}
+
+GLint __glGetPixelMapusv_size(GLenum map)
+{
+ return __glGetPixelMap_size(map);
+}
+
+/*
+** Return the number of words needed to pass back the requested
+** value.
+*/
+GLint __glGet_size(GLenum sq)
+{
+ switch (sq) {
+ case GL_MAX_TEXTURE_SIZE:
+ return 1;
+ case GL_SUBPIXEL_BITS:
+ return 1;
+ case GL_MAX_LIST_NESTING:
+ return 1;
+ case GL_MAP1_COLOR_4:
+ case GL_MAP1_INDEX:
+ case GL_MAP1_NORMAL:
+ case GL_MAP1_TEXTURE_COORD_1:
+ case GL_MAP1_TEXTURE_COORD_2:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_MAP1_VERTEX_3:
+ case GL_MAP1_VERTEX_4:
+ return 1;
+ case GL_MAP2_COLOR_4:
+ case GL_MAP2_INDEX:
+ case GL_MAP2_NORMAL:
+ case GL_MAP2_TEXTURE_COORD_1:
+ case GL_MAP2_TEXTURE_COORD_2:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_MAP2_VERTEX_3:
+ case GL_MAP2_VERTEX_4:
+ return 1;
+ case GL_AUTO_NORMAL:
+ return 1;
+ case GL_CURRENT_COLOR:
+ return 4;
+ case GL_CURRENT_INDEX:
+ return 1;
+ case GL_CURRENT_NORMAL:
+ return 3;
+ case GL_CURRENT_TEXTURE_COORDS:
+ return 4;
+ case GL_CURRENT_RASTER_INDEX:
+ return 1;
+ case GL_CURRENT_RASTER_COLOR:
+ return 4;
+ case GL_CURRENT_RASTER_TEXTURE_COORDS:
+ return 4;
+ case GL_CURRENT_RASTER_POSITION:
+ return 4;
+ case GL_CURRENT_RASTER_POSITION_VALID:
+ return 1;
+ case GL_CURRENT_RASTER_DISTANCE:
+ return 1;
+ case GL_POINT_SIZE:
+ return 1;
+ case GL_POINT_SIZE_RANGE:
+ /* case GL_SMOOTH_POINT_SIZE_RANGE: */ /* alias */
+ return 2;
+ case GL_POINT_SIZE_GRANULARITY:
+ /* case GL_SMOOTH_POINT_SIZE_GRANULARITY: */ /* alias */
+ return 1;
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ return 2;
+ case GL_POINT_SMOOTH:
+ return 1;
+ case GL_LINE_SMOOTH:
+ return 1;
+ case GL_LINE_WIDTH:
+ return 1;
+ case GL_LINE_WIDTH_RANGE:
+ /* case GL_SMOOTH_LINE_WIDTH_RANGE: */ /* alias */
+ return 2;
+ case GL_LINE_WIDTH_GRANULARITY:
+ /* case GL_SMOOTH_LINE_WIDTH_GRANULARITY: */ /* alias */
+ return 1;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ return 2;
+ case GL_LINE_STIPPLE_PATTERN:
+ return 1;
+ case GL_LINE_STIPPLE_REPEAT:
+ return 1;
+ case GL_LINE_STIPPLE:
+ return 1;
+ case GL_POLYGON_MODE:
+ return 2;
+ case GL_POLYGON_SMOOTH:
+ return 1;
+ case GL_POLYGON_STIPPLE:
+ return 1;
+ case GL_EDGE_FLAG:
+ return 1;
+ case GL_CULL_FACE:
+ return 1;
+ case GL_CULL_FACE_MODE:
+ return 1;
+ case GL_FRONT_FACE:
+ return 1;
+ case GL_LIGHTING:
+ return 1;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ return 1;
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ return 1;
+ case GL_LIGHT_MODEL_AMBIENT:
+ return 4;
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ return 1;
+ case GL_COLOR_MATERIAL:
+ return 1;
+ case GL_COLOR_MATERIAL_FACE:
+ return 1;
+ case GL_COLOR_MATERIAL_PARAMETER:
+ return 1;
+ case GL_SHADE_MODEL:
+ return 1;
+ case GL_FOG:
+ return 1;
+ case GL_FOG_INDEX:
+ return 1;
+ case GL_FOG_DENSITY:
+ return 1;
+ case GL_FOG_START:
+ return 1;
+ case GL_FOG_END:
+ return 1;
+ case GL_FOG_MODE:
+ return 1;
+ case GL_FOG_COLOR:
+ return 4;
+ case GL_DEPTH_RANGE:
+ return 2;
+ case GL_DEPTH_TEST:
+ return 1;
+ case GL_DEPTH_WRITEMASK:
+ return 1;
+ case GL_DEPTH_CLEAR_VALUE:
+ return 1;
+ case GL_DEPTH_FUNC:
+ return 1;
+ case GL_ACCUM_CLEAR_VALUE:
+ return 4;
+ case GL_STENCIL_TEST:
+ return 1;
+ case GL_STENCIL_CLEAR_VALUE:
+ return 1;
+ case GL_STENCIL_FUNC:
+ return 1;
+ case GL_STENCIL_VALUE_MASK:
+ return 1;
+ case GL_STENCIL_FAIL:
+ return 1;
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ return 1;
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ return 1;
+ case GL_STENCIL_REF:
+ return 1;
+ case GL_STENCIL_WRITEMASK:
+ return 1;
+ case GL_MATRIX_MODE:
+ return 1;
+ case GL_NORMALIZE:
+ return 1;
+ case GL_VIEWPORT:
+ return 4;
+ case GL_ATTRIB_STACK_DEPTH:
+ return 1;
+ case GL_MODELVIEW_STACK_DEPTH:
+ return 1;
+ case GL_PROJECTION_STACK_DEPTH:
+ return 1;
+ case GL_TEXTURE_STACK_DEPTH:
+ return 1;
+ case GL_MODELVIEW_MATRIX:
+ return 16;
+ case GL_PROJECTION_MATRIX:
+ return 16;
+ case GL_TEXTURE_MATRIX:
+ return 16;
+ case GL_ALPHA_TEST:
+ return 1;
+ case GL_ALPHA_TEST_FUNC:
+ return 1;
+ case GL_ALPHA_TEST_REF:
+ return 1;
+ case GL_DITHER:
+ return 1;
+ case GL_BLEND_DST:
+ return 1;
+ case GL_BLEND_SRC:
+ return 1;
+ case GL_BLEND:
+ return 1;
+ case GL_LOGIC_OP_MODE:
+ return 1;
+ case GL_LOGIC_OP:
+ return 1;
+ case GL_DRAW_BUFFER:
+ return 1;
+ case GL_READ_BUFFER:
+ return 1;
+ case GL_SCISSOR_TEST:
+ return 1;
+ case GL_SCISSOR_BOX:
+ return 4;
+ case GL_INDEX_CLEAR_VALUE:
+ return 1;
+ case GL_INDEX_MODE:
+ return 1;
+ case GL_INDEX_WRITEMASK:
+ return 1;
+ case GL_COLOR_CLEAR_VALUE:
+ return 4;
+ case GL_RGBA_MODE:
+ return 1;
+ case GL_COLOR_WRITEMASK:
+ return 4;
+ case GL_RENDER_MODE:
+ return 1;
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ return 1;
+ case GL_POINT_SMOOTH_HINT:
+ return 1;
+ case GL_LINE_SMOOTH_HINT:
+ return 1;
+ case GL_POLYGON_SMOOTH_HINT:
+ return 1;
+ case GL_FOG_HINT:
+ return 1;
+ case GL_LIST_BASE:
+ return 1;
+ case GL_LIST_INDEX:
+ return 1;
+ case GL_LIST_MODE:
+ return 1;
+ case GL_TEXTURE_GEN_S:
+ return 1;
+ case GL_TEXTURE_GEN_T:
+ return 1;
+ case GL_TEXTURE_GEN_R:
+ return 1;
+ case GL_TEXTURE_GEN_Q:
+ return 1;
+ case GL_PACK_SWAP_BYTES:
+ return 1;
+ case GL_PACK_LSB_FIRST:
+ return 1;
+ case GL_PACK_ROW_LENGTH:
+ return 1;
+ case GL_PACK_IMAGE_HEIGHT:
+ return 1;
+ case GL_PACK_SKIP_ROWS:
+ return 1;
+ case GL_PACK_SKIP_PIXELS:
+ return 1;
+ case GL_PACK_SKIP_IMAGES:
+ return 1;
+ case GL_PACK_ALIGNMENT:
+ return 1;
+ case GL_UNPACK_SWAP_BYTES:
+ return 1;
+ case GL_UNPACK_LSB_FIRST:
+ return 1;
+ case GL_UNPACK_ROW_LENGTH:
+ return 1;
+ case GL_UNPACK_IMAGE_HEIGHT:
+ return 1;
+ case GL_UNPACK_SKIP_ROWS:
+ return 1;
+ case GL_UNPACK_SKIP_PIXELS:
+ return 1;
+ case GL_UNPACK_SKIP_IMAGES:
+ return 1;
+ case GL_UNPACK_ALIGNMENT:
+ return 1;
+ case GL_MAP_COLOR:
+ return 1;
+ case GL_MAP_STENCIL:
+ return 1;
+ case GL_INDEX_SHIFT:
+ return 1;
+ case GL_INDEX_OFFSET:
+ return 1;
+ case GL_RED_SCALE:
+ case GL_GREEN_SCALE:
+ case GL_BLUE_SCALE:
+ case GL_ALPHA_SCALE:
+ case GL_DEPTH_SCALE:
+ return 1;
+ case GL_RED_BIAS:
+ case GL_GREEN_BIAS:
+ case GL_BLUE_BIAS:
+ case GL_ALPHA_BIAS:
+ case GL_DEPTH_BIAS:
+ return 1;
+ case GL_ZOOM_X:
+ case GL_ZOOM_Y:
+ return 1;
+ case GL_PIXEL_MAP_I_TO_I_SIZE: case GL_PIXEL_MAP_S_TO_S_SIZE:
+ case GL_PIXEL_MAP_I_TO_R_SIZE: case GL_PIXEL_MAP_I_TO_G_SIZE:
+ case GL_PIXEL_MAP_I_TO_B_SIZE: case GL_PIXEL_MAP_I_TO_A_SIZE:
+ case GL_PIXEL_MAP_R_TO_R_SIZE: case GL_PIXEL_MAP_G_TO_G_SIZE:
+ case GL_PIXEL_MAP_B_TO_B_SIZE: case GL_PIXEL_MAP_A_TO_A_SIZE:
+ return 1;
+ case GL_MAX_EVAL_ORDER:
+ return 1;
+ case GL_MAX_LIGHTS:
+ return 1;
+ case GL_MAX_CLIP_PLANES:
+ return 1;
+ case GL_MAX_PIXEL_MAP_TABLE:
+ return 1;
+ case GL_MAX_ATTRIB_STACK_DEPTH:
+ return 1;
+ case GL_MAX_MODELVIEW_STACK_DEPTH:
+ return 1;
+ case GL_MAX_NAME_STACK_DEPTH:
+ return 1;
+ case GL_MAX_PROJECTION_STACK_DEPTH:
+ return 1;
+ case GL_MAX_TEXTURE_STACK_DEPTH:
+ return 1;
+ case GL_INDEX_BITS:
+ return 1;
+ case GL_RED_BITS:
+ return 1;
+ case GL_GREEN_BITS:
+ return 1;
+ case GL_BLUE_BITS:
+ return 1;
+ case GL_ALPHA_BITS:
+ return 1;
+ case GL_DEPTH_BITS:
+ return 1;
+ case GL_STENCIL_BITS:
+ return 1;
+ case GL_ACCUM_RED_BITS:
+ case GL_ACCUM_GREEN_BITS:
+ case GL_ACCUM_BLUE_BITS:
+ case GL_ACCUM_ALPHA_BITS:
+ return 1;
+ case GL_MAP1_GRID_DOMAIN:
+ return 2;
+ case GL_MAP1_GRID_SEGMENTS:
+ return 1;
+ case GL_MAP2_GRID_DOMAIN:
+ return 4;
+ case GL_MAP2_GRID_SEGMENTS:
+ return 2;
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ return 1;
+ case GL_NAME_STACK_DEPTH:
+ return 1;
+ case GL_MAX_VIEWPORT_DIMS:
+ return 2;
+ case GL_DOUBLEBUFFER:
+ return 1;
+ case GL_AUX_BUFFERS:
+ return 1;
+ case GL_STEREO:
+ return 1;
+ case GL_CLIP_PLANE0: case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2: case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4: case GL_CLIP_PLANE5:
+ return 1;
+ case GL_LIGHT0: case GL_LIGHT1:
+ case GL_LIGHT2: case GL_LIGHT3:
+ case GL_LIGHT4: case GL_LIGHT5:
+ case GL_LIGHT6: case GL_LIGHT7:
+ return 1;
+ case GL_VERTEX_ARRAY:
+ case GL_VERTEX_ARRAY_SIZE:
+ case GL_VERTEX_ARRAY_TYPE:
+ case GL_VERTEX_ARRAY_STRIDE:
+ case GL_NORMAL_ARRAY:
+ case GL_NORMAL_ARRAY_TYPE:
+ case GL_NORMAL_ARRAY_STRIDE:
+ case GL_COLOR_ARRAY:
+ case GL_COLOR_ARRAY_SIZE:
+ case GL_COLOR_ARRAY_TYPE:
+ case GL_COLOR_ARRAY_STRIDE:
+ case GL_INDEX_ARRAY:
+ case GL_INDEX_ARRAY_TYPE:
+ case GL_INDEX_ARRAY_STRIDE:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_EDGE_FLAG_ARRAY_STRIDE:
+ return 1;
+ case GL_TEXTURE_BINDING_1D:
+ case GL_TEXTURE_BINDING_2D:
+ case GL_TEXTURE_BINDING_3D:
+ return 1;
+ case GL_BLEND_COLOR:
+ return 4;
+ case GL_BLEND_EQUATION:
+ return 1;
+ case GL_COLOR_MATRIX:
+ return 16;
+ case GL_COLOR_MATRIX_STACK_DEPTH:
+ return 1;
+ case GL_COLOR_TABLE:
+ case GL_POST_CONVOLUTION_COLOR_TABLE:
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE:
+ case GL_CONVOLUTION_1D:
+ case GL_CONVOLUTION_2D:
+ case GL_SEPARABLE_2D:
+ case GL_HISTOGRAM:
+ case GL_MINMAX:
+ return 1;
+ case GL_POLYGON_OFFSET_FACTOR:
+ case GL_POLYGON_OFFSET_UNITS:
+ return 1;
+ case GL_POST_CONVOLUTION_RED_SCALE:
+ case GL_POST_CONVOLUTION_GREEN_SCALE:
+ case GL_POST_CONVOLUTION_BLUE_SCALE:
+ case GL_POST_CONVOLUTION_ALPHA_SCALE:
+ case GL_POST_CONVOLUTION_RED_BIAS:
+ case GL_POST_CONVOLUTION_GREEN_BIAS:
+ case GL_POST_CONVOLUTION_BLUE_BIAS:
+ case GL_POST_CONVOLUTION_ALPHA_BIAS:
+ return 1;
+ case GL_POST_COLOR_MATRIX_RED_SCALE:
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE:
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE:
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE:
+ case GL_POST_COLOR_MATRIX_RED_BIAS:
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS:
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS:
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS:
+ return 1;
+ case GL_RESCALE_NORMAL:
+ return 1;
+ case GL_MAX_ELEMENTS_INDICES:
+ case GL_MAX_ELEMENTS_VERTICES:
+ return 1;
+ case GL_ACTIVE_TEXTURE_ARB:
+ case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ case GL_MAX_TEXTURE_UNITS_ARB:
+ return 1;
+ case GL_MAX_COLOR_MATRIX_STACK_DEPTH:
+ case GL_MAX_CONVOLUTION_WIDTH:
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ return 1;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ case GL_OCCLUSION_TEST_HP:
+ return 1;
+ case GL_PACK_INVERT_MESA:
+ return 1;
+ case GL_CULL_VERTEX_IBM:
+ return 1;
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ return 1;
+
+ /* GL_ARB_texture_cube_map / GL 1.3 */
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_BINDING_CUBE_MAP:
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+
+ /* GL_ARB_multisample / GL 1.3 */
+ case GL_MULTISAMPLE:
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+ case GL_SAMPLE_ALPHA_TO_ONE:
+ case GL_SAMPLE_COVERAGE:
+ case GL_SAMPLE_BUFFERS:
+ case GL_SAMPLES:
+ case GL_SAMPLE_COVERAGE_VALUE:
+ case GL_SAMPLE_COVERAGE_INVERT:
+
+ /* GL_ARB_texture_comrpession / GL 1.3 */
+ case GL_TEXTURE_COMPRESSION_HINT:
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
+
+ /* GL_EXT_blend_func_separate / GL 1.4 */
+ case GL_BLEND_DST_RGB:
+ case GL_BLEND_SRC_RGB:
+ case GL_BLEND_DST_ALPHA:
+ case GL_BLEND_SRC_ALPHA:
+
+ /* GL_EXT_fog_coord / GL 1.4 */
+ case GL_CURRENT_FOG_COORD:
+ case GL_FOG_COORD_ARRAY_TYPE:
+ case GL_FOG_COORD_ARRAY_STRIDE:
+ case GL_FOG_COORD_ARRAY:
+ case GL_FOG_COORD_SRC:
+
+ /* GL_EXT_secondary_color / GL 1.4 */
+ case GL_COLOR_SUM:
+ case GL_SECONDARY_COLOR_ARRAY_SIZE:
+ case GL_SECONDARY_COLOR_ARRAY_TYPE:
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE:
+ case GL_SECONDARY_COLOR_ARRAY:
+
+ /* GL_EXT_texture_lod_bias / GL 1.4 */
+ case GL_MAX_TEXTURE_LOD_BIAS:
+
+ /* GL_ARB_point_sprite */
+ case GL_POINT_SPRITE_ARB:
+
+ /* GL_ARB_vertex_blend */
+ case GL_MAX_VERTEX_UNITS_ARB:
+ case GL_ACTIVE_VERTEX_UNITS_ARB:
+ case GL_WEIGHT_SUM_UNITY_ARB:
+ case GL_VERTEX_BLEND_ARB:
+ case GL_CURRENT_WEIGHT_ARB:
+ case GL_WEIGHT_ARRAY_ARB:
+ case GL_WEIGHT_ARRAY_TYPE_ARB:
+ case GL_WEIGHT_ARRAY_STRIDE_ARB:
+ case GL_WEIGHT_ARRAY_SIZE_ARB:
+
+ /* GL_ARB_matrix_palette */
+ case GL_MATRIX_PALETTE_ARB:
+ case GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB:
+ case GL_MAX_PALETTE_MATRICES_ARB:
+ case GL_CURRENT_PALETTE_MATRIX_ARB:
+ case GL_CURRENT_MATRIX_INDEX_ARB:
+ case GL_MATRIX_INDEX_ARRAY_ARB:
+ case GL_MATRIX_INDEX_ARRAY_SIZE_ARB:
+ case GL_MATRIX_INDEX_ARRAY_TYPE_ARB:
+ case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB:
+
+ /* GL_EXT_clip_volume_hint */
+ case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+
+ /* GL_EXT_stencil_two_size */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+
+ /* GL_EXT_vertex_weighting */
+ case GL_VERTEX_WEIGHTING_EXT:
+ case GL_MODELVIEW0_EXT:
+ case GL_MODELVIEW1_EXT:
+ case GL_CURRENT_VERTEX_WEIGHT_EXT:
+ case GL_VERTEX_WEIGHT_ARRAY_EXT:
+ case GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT:
+ case GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT:
+ case GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT:
+ /* case GL_MODELVIEW0_STACK_DEPTH_EXT: */ /* alias */
+ case GL_MODELVIEW1_STACK_DEPTH_EXT:
+
+ /* GL_EXT_blend_equation_separate */
+ /* case GL_BLEND_EQUATION_RGB_EXT: */ /* alias */
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+
+ /* GL_ATI_vertex_streams */
+ case GL_MAX_VERTEX_STREAMS_ATI:
+
+ /* GL_ATI_draw_buffers */
+ case GL_MAX_DRAW_BUFFERS_ATI:
+ case GL_DRAW_BUFFER0_ATI:
+ case GL_DRAW_BUFFER1_ATI:
+ case GL_DRAW_BUFFER2_ATI:
+ case GL_DRAW_BUFFER3_ATI:
+ case GL_DRAW_BUFFER4_ATI:
+ case GL_DRAW_BUFFER5_ATI:
+ case GL_DRAW_BUFFER6_ATI:
+ case GL_DRAW_BUFFER7_ATI:
+ case GL_DRAW_BUFFER8_ATI:
+ case GL_DRAW_BUFFER9_ATI:
+ case GL_DRAW_BUFFER10_ATI:
+ case GL_DRAW_BUFFER11_ATI:
+ case GL_DRAW_BUFFER12_ATI:
+ case GL_DRAW_BUFFER13_ATI:
+ case GL_DRAW_BUFFER14_ATI:
+ case GL_DRAW_BUFFER15_ATI:
+
+ /* GL_ATI_separate_stencil */
+ case GL_STENCIL_BACK_FUNC_ATI:
+ case GL_STENCIL_BACK_FAIL_ATI:
+ case GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI:
+ case GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI:
+
+ /* GL_NV_depth_clamp */
+ case GL_DEPTH_CLAMP_NV:
+
+ /* GL_NV_fog_distance */
+ case GL_FOG_DISTANCE_MODE_NV:
+
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ case GL_MAX_SPOT_EXPONENT_NV:
+
+ /* GL_NV_multisample_filter_hint */
+ case GL_MULTISAMPLE_FILTER_HINT_NV:
+
+ /* GL_NV_point_sprite */
+ /* case GL_POINT_SPRITE_NV: */ /* alias */
+ case GL_POINT_SPRITE_R_MODE_NV:
+
+ /* GL_NV_primitive_restart */
+ case GL_PRIMITIVE_RESTART_NV:
+ case GL_PRIMITIVE_RESTART_INDEX_NV:
+
+ /* GL_NV_register_combiners */
+ case GL_REGISTER_COMBINERS_NV:
+ case GL_NUM_GENERAL_COMBINERS_NV:
+ case GL_COLOR_SUM_CLAMP_NV:
+ case GL_MAX_GENERAL_COMBINERS_NV:
+
+ /* GL_NV_register_combiners2 */
+ case GL_PER_STAGE_CONSTANTS_NV:
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
+ return 1;
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_EXT:
+ return 2;
+
+ /* GL_EXT_secondary_color / GL 1.4 */
+ case GL_CURRENT_SECONDARY_COLOR:
+
+ /* GL_NV_register_combiners */
+ case GL_CONSTANT_COLOR0_NV:
+ case GL_CONSTANT_COLOR1_NV:
+ return 4;
+
+ /* GL_ARB_vertex_blend */
+ /* case GL_MODELVIEW0_ARB: */ /* alias */
+ /* case GL_MODELVIEW1_ARB: */ /* alias */
+ case GL_MODELVIEW2_ARB:
+ case GL_MODELVIEW3_ARB:
+ case GL_MODELVIEW4_ARB:
+ case GL_MODELVIEW5_ARB:
+ case GL_MODELVIEW6_ARB:
+ case GL_MODELVIEW7_ARB:
+ case GL_MODELVIEW8_ARB:
+ case GL_MODELVIEW9_ARB:
+ case GL_MODELVIEW10_ARB:
+ case GL_MODELVIEW11_ARB:
+ case GL_MODELVIEW12_ARB:
+ case GL_MODELVIEW13_ARB:
+ case GL_MODELVIEW14_ARB:
+ case GL_MODELVIEW15_ARB:
+ case GL_MODELVIEW16_ARB:
+ case GL_MODELVIEW17_ARB:
+ case GL_MODELVIEW18_ARB:
+ case GL_MODELVIEW19_ARB:
+ case GL_MODELVIEW20_ARB:
+ case GL_MODELVIEW21_ARB:
+ case GL_MODELVIEW22_ARB:
+ case GL_MODELVIEW23_ARB:
+ case GL_MODELVIEW24_ARB:
+ case GL_MODELVIEW25_ARB:
+ case GL_MODELVIEW26_ARB:
+ case GL_MODELVIEW27_ARB:
+ case GL_MODELVIEW28_ARB:
+ case GL_MODELVIEW29_ARB:
+ case GL_MODELVIEW30_ARB:
+ case GL_MODELVIEW31_ARB:
+
+ /* GL_EXT_vertex_weighting */
+ /* case GL_MODELVIEW0_MATRIX_EXT: */ /* alias */
+ case GL_MODELVIEW1_MATRIX_EXT:
+ return 32;
+
+ /* GL_ARB_texture_comrpession / GL 1.3 */
+ case GL_COMPRESSED_TEXTURE_FORMATS: {
+ GLint temp;
+
+ glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS, & temp );
+ return temp;
+ }
+
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetDoublev_size(GLenum sq)
+{
+ return __glGet_size(sq);
+}
+
+GLint __glGetFloatv_size(GLenum sq)
+{
+ return __glGet_size(sq);
+}
+
+GLint __glGetIntegerv_size(GLenum sq)
+{
+ return __glGet_size(sq);
+}
+
+GLint __glGetBooleanv_size(GLenum sq)
+{
+ return __glGet_size(sq);
+}
+
+GLint __glGetTexLevelParameterfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_WIDTH:
+ case GL_TEXTURE_HEIGHT:
+ case GL_TEXTURE_DEPTH:
+ case GL_TEXTURE_COMPONENTS:
+ case GL_TEXTURE_BORDER:
+ case GL_TEXTURE_RED_SIZE:
+ case GL_TEXTURE_GREEN_SIZE:
+ case GL_TEXTURE_BLUE_SIZE:
+ case GL_TEXTURE_ALPHA_SIZE:
+ case GL_TEXTURE_LUMINANCE_SIZE:
+ case GL_TEXTURE_INTENSITY_SIZE:
+
+ /* GL_ARB_texture_compression / GL 1.3 */
+ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
+ case GL_TEXTURE_COMPRESSED:
+
+ /* GL_ARB_depth_texture / GL 1.4 */
+ case GL_TEXTURE_DEPTH_SIZE:
+ return 1;
+
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetTexLevelParameteriv_size(GLenum pname)
+{
+ return __glGetTexLevelParameterfv_size(pname);
+}
+
+GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
+ GLenum type, GLint width, GLint height, GLint depth)
+{
+ return __glXImageSize( format, type, target, width, height, depth,
+ 0, 0, 0, 0, 4 );
+}
+
+GLint __glGetConvolutionParameteriv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_CONVOLUTION_BORDER_COLOR:
+ case GL_CONVOLUTION_FILTER_SCALE:
+ case GL_CONVOLUTION_FILTER_BIAS:
+ return 4;
+ case GL_CONVOLUTION_BORDER_MODE:
+ case GL_CONVOLUTION_FORMAT:
+ case GL_CONVOLUTION_WIDTH:
+ case GL_CONVOLUTION_HEIGHT:
+ case GL_MAX_CONVOLUTION_WIDTH:
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetConvolutionParameterfv_size(GLenum pname)
+{
+ return __glGetConvolutionParameteriv_size(pname);
+}
+
+
+GLint __glGetHistogramParameterfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_HISTOGRAM_WIDTH:
+ case GL_HISTOGRAM_FORMAT:
+ case GL_HISTOGRAM_RED_SIZE:
+ case GL_HISTOGRAM_GREEN_SIZE:
+ case GL_HISTOGRAM_BLUE_SIZE:
+ case GL_HISTOGRAM_ALPHA_SIZE:
+ case GL_HISTOGRAM_LUMINANCE_SIZE:
+ case GL_HISTOGRAM_SINK:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetHistogramParameteriv_size(GLenum pname)
+{
+ return __glGetHistogramParameterfv_size(pname);
+}
+
+GLint __glGetMinmaxParameterfv_size(GLenum pname)
+{
+ switch (pname) {
+ case GL_MINMAX_FORMAT:
+ case GL_MINMAX_SINK:
+ return 1;
+ default:
+ return -1;
+ }
+}
+
+GLint __glGetMinmaxParameteriv_size(GLenum pname)
+{
+ return __glGetMinmaxParameterfv_size(pname);
+}
+
+GLint __glGetColorTableParameterfv_size(GLenum pname)
+{
+ switch(pname) {
+
+ case GL_COLOR_TABLE_SCALE: /* return RGBA */
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ case GL_COLOR_TABLE_FORMAT:
+ case GL_COLOR_TABLE_WIDTH:
+ case GL_COLOR_TABLE_RED_SIZE:
+ case GL_COLOR_TABLE_GREEN_SIZE:
+ case GL_COLOR_TABLE_BLUE_SIZE:
+ case GL_COLOR_TABLE_ALPHA_SIZE:
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+GLint __glGetColorTableParameteriv_size(GLenum pname)
+{
+ return __glGetColorTableParameterfv_size(pname);
+}
+
diff --git a/nx-X11/programs/Xserver/GL/glx/singlesize.h b/nx-X11/programs/Xserver/GL/glx/singlesize.h
new file mode 100644
index 000000000..4804a9982
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/singlesize.h
@@ -0,0 +1,87 @@
+/* $XFree86$ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _singlesize_h_
+#define _singlesize_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#include "indirect_size.h"
+
+extern GLint __glReadPixels_size(GLenum format, GLenum type,
+ GLint width, GLint height);
+extern GLint __glGetTexEnvfv_size(GLenum pname);
+extern GLint __glGetTexEnviv_size(GLenum pname);
+extern GLint __glGetTexGenfv_size(GLenum pname);
+extern GLint __glGetTexGendv_size(GLenum pname);
+extern GLint __glGetTexGeniv_size(GLenum pname);
+extern GLint __glGetTexParameterfv_size(GLenum pname);
+extern GLint __glGetTexParameteriv_size(GLenum pname);
+extern GLint __glGetLightfv_size(GLenum pname);
+extern GLint __glGetLightiv_size(GLenum pname);
+extern GLint __glGetMap_size(GLenum pname, GLenum query);
+extern GLint __glGetMapdv_size(GLenum target, GLenum query);
+extern GLint __glGetMapfv_size(GLenum target, GLenum query);
+extern GLint __glGetMapiv_size(GLenum target, GLenum query);
+extern GLint __glGetMaterialfv_size(GLenum pname);
+extern GLint __glGetMaterialiv_size(GLenum pname);
+extern GLint __glGetPixelMap_size(GLenum map);
+extern GLint __glGetPixelMapfv_size(GLenum map);
+extern GLint __glGetPixelMapuiv_size(GLenum map);
+extern GLint __glGetPixelMapusv_size(GLenum map);
+extern GLint __glGet_size(GLenum sq);
+extern GLint __glGetDoublev_size(GLenum sq);
+extern GLint __glGetFloatv_size(GLenum sq);
+extern GLint __glGetIntegerv_size(GLenum sq);
+extern GLint __glGetBooleanv_size(GLenum sq);
+extern GLint __glGetTexLevelParameterfv_size(GLenum pname);
+extern GLint __glGetTexLevelParameteriv_size(GLenum pname);
+extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
+ GLenum type, GLint width, GLint height,
+ GLint depth);
+extern GLint __glGetColorTableParameterfv_size(GLenum pname);
+extern GLint __glGetColorTableParameteriv_size(GLenum pname);
+extern GLint __glGetConvolutionParameterfv_size(GLenum pname);
+extern GLint __glGetConvolutionParameteriv_size(GLenum pname);
+extern GLint __glGetHistogramParameterfv_size(GLenum pname);
+extern GLint __glGetHistogramParameteriv_size(GLenum pname);
+extern GLint __glGetMinmaxParameterfv_size(GLenum pname);
+extern GLint __glGetMinmaxParameteriv_size(GLenum pname);
+
+#endif /* _singlesize_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h
new file mode 100644
index 000000000..723fb85f3
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/unpack.h
@@ -0,0 +1,240 @@
+/* $XFree86: xc/programs/Xserver/GL/glx/unpack.h,v 1.4 2002/01/14 22:47:08 tsi Exp $ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef __GLX_unpack_h__
+#define __GLX_unpack_h__
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
+
+/*
+** Fetch the context-id out of a SingleReq request pointed to by pc.
+*/
+#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
+#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
+
+/*
+** Fetch a double from potentially unaligned memory.
+*/
+#ifdef __GLX_ALIGN64
+#define __GLX_MEM_COPY(dst,src,n) if (src && dst) memcpy(dst,src,n)
+#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
+#else
+#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
+#endif
+
+extern void __glXMemInit(void);
+
+extern xGLXSingleReply __glXReply;
+
+#define __GLX_BEGIN_REPLY(size) \
+ __glXReply.length = __GLX_PAD(size) >> 2; \
+ __glXReply.type = X_Reply; \
+ __glXReply.sequenceNumber = client->sequence;
+
+#define __GLX_SEND_HEADER() \
+ WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
+
+#define __GLX_PUT_RETVAL(a) \
+ __glXReply.retval = (a);
+
+#define __GLX_PUT_SIZE(a) \
+ __glXReply.size = (a);
+
+#define __GLX_PUT_RENDERMODE(m) \
+ __glXReply.pad3 = (m)
+
+/*
+** Get a buffer to hold returned data, with the given alignment. If we have
+** to realloc, allocate size+align, in case the pointer has to be bumped for
+** alignment. The answerBuffer should already be aligned.
+**
+** NOTE: the cast (long)res below assumes a long is large enough to hold a
+** pointer.
+*/
+#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
+ if ((size) > sizeof(answerBuffer)) { \
+ int bump; \
+ if ((cl)->returnBufSize < (size)+(align)) { \
+ (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
+ (size)+(align)); \
+ if (!(cl)->returnBuf) { \
+ return BadAlloc; \
+ } \
+ (cl)->returnBufSize = (size)+(align); \
+ } \
+ res = (char*)cl->returnBuf; \
+ bump = (long)(res) % (align); \
+ if (bump) res += (align) - (bump); \
+ } else { \
+ res = (char *)answerBuffer; \
+ }
+
+#define __GLX_PUT_BYTE() \
+ *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
+
+#define __GLX_PUT_SHORT() \
+ *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
+
+#define __GLX_PUT_INT() \
+ *(GLint *)&__glXReply.pad3 = *(GLint *)answer
+
+#define __GLX_PUT_FLOAT() \
+ *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
+
+#define __GLX_PUT_DOUBLE() \
+ *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
+
+#define __GLX_SEND_BYTE_ARRAY(len) \
+ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
+
+#define __GLX_SEND_SHORT_ARRAY(len) \
+ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
+
+#define __GLX_SEND_INT_ARRAY(len) \
+ WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
+
+#define __GLX_SEND_FLOAT_ARRAY(len) \
+ WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
+
+#define __GLX_SEND_DOUBLE_ARRAY(len) \
+ WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
+
+
+#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
+#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
+#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
+#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
+
+/*
+** PERFORMANCE NOTE:
+** Machine dependent optimizations abound here; these swapping macros can
+** conceivably be replaced with routines that do the job faster.
+*/
+#define __GLX_DECLARE_SWAP_VARIABLES \
+ GLbyte sw
+
+#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
+ GLbyte *swapPC; \
+ GLbyte *swapEnd
+
+
+#define __GLX_SWAP_INT(pc) \
+ sw = ((GLbyte *)(pc))[0]; \
+ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
+ ((GLbyte *)(pc))[3] = sw; \
+ sw = ((GLbyte *)(pc))[1]; \
+ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
+ ((GLbyte *)(pc))[2] = sw;
+
+#define __GLX_SWAP_SHORT(pc) \
+ sw = ((GLbyte *)(pc))[0]; \
+ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
+ ((GLbyte *)(pc))[1] = sw;
+
+#define __GLX_SWAP_DOUBLE(pc) \
+ sw = ((GLbyte *)(pc))[0]; \
+ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
+ ((GLbyte *)(pc))[7] = sw; \
+ sw = ((GLbyte *)(pc))[1]; \
+ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
+ ((GLbyte *)(pc))[6] = sw; \
+ sw = ((GLbyte *)(pc))[2]; \
+ ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
+ ((GLbyte *)(pc))[5] = sw; \
+ sw = ((GLbyte *)(pc))[3]; \
+ ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
+ ((GLbyte *)(pc))[4] = sw;
+
+#define __GLX_SWAP_FLOAT(pc) \
+ sw = ((GLbyte *)(pc))[0]; \
+ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
+ ((GLbyte *)(pc))[3] = sw; \
+ sw = ((GLbyte *)(pc))[1]; \
+ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
+ ((GLbyte *)(pc))[2] = sw;
+
+#define __GLX_SWAP_INT_ARRAY(pc, count) \
+ swapPC = ((GLbyte *)(pc)); \
+ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
+ while (swapPC < swapEnd) { \
+ __GLX_SWAP_INT(swapPC); \
+ swapPC += __GLX_SIZE_INT32; \
+ }
+
+#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
+ swapPC = ((GLbyte *)(pc)); \
+ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
+ while (swapPC < swapEnd) { \
+ __GLX_SWAP_SHORT(swapPC); \
+ swapPC += __GLX_SIZE_INT16; \
+ }
+
+#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
+ swapPC = ((GLbyte *)(pc)); \
+ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
+ while (swapPC < swapEnd) { \
+ __GLX_SWAP_DOUBLE(swapPC); \
+ swapPC += __GLX_SIZE_FLOAT64; \
+ }
+
+#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
+ swapPC = ((GLbyte *)(pc)); \
+ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
+ while (swapPC < swapEnd) { \
+ __GLX_SWAP_FLOAT(swapPC); \
+ swapPC += __GLX_SIZE_FLOAT32; \
+ }
+
+#define __GLX_SWAP_REPLY_HEADER() \
+ __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
+ __GLX_SWAP_INT(&__glXReply.length);
+
+#define __GLX_SWAP_REPLY_RETVAL() \
+ __GLX_SWAP_INT(&__glXReply.retval)
+
+#define __GLX_SWAP_REPLY_SIZE() \
+ __GLX_SWAP_INT(&__glXReply.size)
+
+#endif /* !__GLX_unpack_h__ */
+
+
+
+
+
diff --git a/nx-X11/programs/Xserver/GL/glx/xfont.c b/nx-X11/programs/Xserver/GL/glx/xfont.c
new file mode 100644
index 000000000..c4995e272
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glx/xfont.c
@@ -0,0 +1,195 @@
+/* $XFree86$ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "g_disptab.h"
+#include <unpack.h>
+#include <GL/gl.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include <dixfontstr.h>
+
+extern XID clientErrorValue; /* imported kludge from dix layer */
+
+/*
+** Make a single GL bitmap from a single X glyph
+*/
+static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
+{
+ int i, j;
+ int widthPadded; /* width of glyph in bytes, as padded by X */
+ int allocBytes; /* bytes to allocate to store bitmap */
+ int w; /* width of glyph in bits */
+ int h; /* height of glyph */
+ register unsigned char *pglyph;
+ register unsigned char *p;
+ unsigned char *allocbuf;
+#define __GL_CHAR_BUF_SIZE 2048
+ unsigned char buf[__GL_CHAR_BUF_SIZE];
+
+ w = GLYPHWIDTHPIXELS(pci);
+ h = GLYPHHEIGHTPIXELS(pci);
+ widthPadded = GLYPHWIDTHBYTESPADDED(pci);
+
+ /*
+ ** Use the local buf if possible, otherwise malloc.
+ */
+ allocBytes = widthPadded * h;
+ if (allocBytes <= __GL_CHAR_BUF_SIZE) {
+ p = buf;
+ allocbuf = 0;
+ } else {
+ p = (unsigned char *) __glXMalloc(allocBytes);
+ if (!p)
+ return BadAlloc;
+ allocbuf = p;
+ }
+
+ /*
+ ** We have to reverse the picture, top to bottom
+ */
+
+ pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
+ for (j=0; j < h; j++) {
+ for (i=0; i < widthPadded; i++) {
+ p[i] = pglyph[i];
+ }
+ pglyph -= widthPadded;
+ p += widthPadded;
+ }
+ glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
+ pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
+
+ if (allocbuf) {
+ __glXFree(allocbuf);
+ }
+ return Success;
+#undef __GL_CHAR_BUF_SIZE
+}
+
+/*
+** Create a GL bitmap for each character in the X font. The bitmap is stored
+** in a display list.
+*/
+
+static int
+MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
+{
+ unsigned long i, nglyphs;
+ CARD8 chs[2]; /* the font index we are going after */
+ CharInfoPtr pci;
+ int rv; /* return value */
+ int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
+ for (i=0; i < count; i++) {
+ chs[0] = (first + i) >> 8; /* high byte is first byte */
+ chs[1] = first + i;
+
+ (*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
+ &nglyphs, &pci);
+
+ /*
+ ** Define a display list containing just a glBitmap() call.
+ */
+ glNewList(list_base + i, GL_COMPILE);
+ if (nglyphs ) {
+ rv = __glXMakeBitmapFromGlyph(pFont, pci);
+ if (rv) {
+ return rv;
+ }
+ }
+ glEndList();
+ }
+ return Success;
+}
+
+/************************************************************************/
+
+int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXUseXFontReq *req;
+ FontPtr pFont;
+ GC *pGC;
+ GLuint currentListIndex;
+ __GLXcontext *cx;
+ int error;
+
+ req = (xGLXUseXFontReq *) pc;
+ cx = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!cx) {
+ return error;
+ }
+
+ glGetIntegerv(GL_LIST_INDEX, (GLint*) &currentListIndex);
+ if (currentListIndex != 0) {
+ /*
+ ** A display list is currently being made. It is an error
+ ** to try to make a font during another lists construction.
+ */
+ client->errorValue = cx->id;
+ return __glXBadContextState;
+ }
+
+ /*
+ ** Font can actually be either the ID of a font or the ID of a GC
+ ** containing a font.
+ */
+ pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
+ if (!pFont) {
+ pGC = (GC *)LookupIDByType(req->font, RT_GC);
+ if (!pGC) {
+ client->errorValue = req->font;
+ return BadFont;
+ }
+ pFont = pGC->font;
+ }
+
+ return MakeBitmapsFromFont(pFont, req->first, req->count,
+ req->listBase);
+}
diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c
new file mode 100644
index 000000000..f8c03913e
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/glxmodule.c
@@ -0,0 +1,1270 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+#include "colormap.h"
+#include "micmap.h"
+#include "globals.h"
+
+static MODULESETUPPROTO(glxSetup);
+
+extern void GlxExtensionInit(INITARGS);
+extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *));
+
+static const char *initdeps[] = { "DOUBLE-BUFFER", NULL };
+
+ExtensionModule GLXExt =
+{
+ GlxExtensionInit,
+ "GLX",
+ &noGlxExtension,
+ NULL,
+ initdeps
+};
+
+static const char *glcoreSymbols[] = {
+ "__glCallLists_size",
+ "__glColorTableParameterfv_size",
+ "__glColorTableParameteriv_size",
+ "__glConvolutionParameterfv_size",
+ "__glConvolutionParameteriv_size",
+ "__glDDXExtensionInfo",
+ "__glDDXScreenInfo",
+ "__glFloorLog2",
+ "__glFogfv_size",
+ "__glFogiv_size",
+ "__glGetBooleanv_size",
+ "__glGetColorTableParameterfv_size",
+ "__glGetColorTableParameteriv_size",
+ "__glGetConvolutionParameterfv_size",
+ "__glGetConvolutionParameteriv_size",
+ "__glGetDoublev_size",
+ "__glGetFloatv_size",
+ "__glGetHistogramParameterfv_size",
+ "__glGetHistogramParameteriv_size",
+ "__glGetIntegerv_size",
+ "__glGetLightfv_size",
+ "__glGetLightiv_size",
+ "__glGetMapdv_size",
+ "__glGetMapfv_size",
+ "__glGetMapiv_size",
+ "__glGetMaterialfv_size",
+ "__glGetMaterialiv_size",
+ "__glGetMinmaxParameterfv_size",
+ "__glGetMinmaxParameteriv_size",
+ "__glGetPixelMapfv_size",
+ "__glGetPixelMapuiv_size",
+ "__glGetPixelMapusv_size",
+ "__glGetTexEnvfv_size",
+ "__glGetTexEnviv_size",
+ "__glGetTexGendv_size",
+ "__glGetTexGenfv_size",
+ "__glGetTexGeniv_size",
+ "__glGetTexImage_size",
+ "__glGetTexLevelParameterfv_size",
+ "__glGetTexLevelParameteriv_size",
+ "__glGetTexParameterfv_size",
+ "__glGetTexParameteriv_size",
+ "__glLightModelfv_size",
+ "__glLightModeliv_size",
+ "__glLightfv_size",
+ "__glLightiv_size",
+ "__glMaterialfv_size",
+ "__glMaterialiv_size",
+ "__glPointParameterfvARB_size",
+ "__glReadPixels_size",
+ "__glTexEnvfv_size",
+ "__glTexEnviv_size",
+ "__glTexGendv_size",
+ "__glTexGenfv_size",
+ "__glTexGeniv_size",
+ "__glTexParameterfv_size",
+ "__glTexParameteriv_size",
+ "__glXglDDXExtensionInfo",
+ "__glXglDDXScreenInfo",
+ "__glXActiveScreens",
+ "__glXAssociateContext",
+ "__glXBadContext",
+ "__glXBadContextState",
+ "__glXBadContextTag",
+ "__glXBadCurrentWindow",
+ "__glXBadDrawable",
+ "__glXBadLargeRequest",
+ "__glXBadPixmap",
+ "__glXBadRenderRequest",
+ "__glXBitmapReqSize",
+ "__glXCacheDrawableSize",
+ "__glXCallListsReqSize",
+ "__glXClearErrorOccured",
+ "__glXClientInfo",
+ "__glXClientRes",
+ "__glXClients",
+ "__glXColorSubTableReqSize",
+ "__glXColorTableParameterfvReqSize",
+ "__glXColorTableParameterivReqSize",
+ "__glXColorTableReqSize",
+ "__glXContextRes",
+ "__glXConvolutionFilter1DReqSize",
+ "__glXConvolutionFilter2DReqSize",
+ "__glXConvolutionParameterfvReqSize",
+ "__glXConvolutionParameterivReqSize",
+ "__glXCopyContext",
+ "__glXCoreType",
+ "__glXCreateContext",
+ "__glXCreateGLXPixmap",
+ "__glXDeassociateContext",
+ "__glXDestroyContext",
+ "__glXDestroyGLXPixmap",
+ "__glXDispSwap_Accum",
+ "__glXDispSwap_ActiveStencilFaceEXT",
+ "__glXDispSwap_ActiveTextureARB",
+ "__glXDispSwap_AlphaFunc",
+ "__glXDispSwap_AreTexturesResident",
+ "__glXDispSwap_AreTexturesResidentEXT",
+ "__glXDispSwap_Begin",
+ "__glXDispSwap_BindTexture",
+ "__glXDispSwap_Bitmap",
+ "__glXDispSwap_BlendColor",
+ "__glXDispSwap_BlendEquation",
+ "__glXDispSwap_BlendFunc",
+ "__glXDispSwap_CallList",
+ "__glXDispSwap_CallLists",
+ "__glXDispSwap_Clear",
+ "__glXDispSwap_ClearAccum",
+ "__glXDispSwap_ClearColor",
+ "__glXDispSwap_ClearDepth",
+ "__glXDispSwap_ClearIndex",
+ "__glXDispSwap_ClearStencil",
+ "__glXDispSwap_ClipPlane",
+ "__glXDispSwap_Color3bv",
+ "__glXDispSwap_Color3dv",
+ "__glXDispSwap_Color3fv",
+ "__glXDispSwap_Color3iv",
+ "__glXDispSwap_Color3sv",
+ "__glXDispSwap_Color3ubv",
+ "__glXDispSwap_Color3uiv",
+ "__glXDispSwap_Color3usv",
+ "__glXDispSwap_Color4bv",
+ "__glXDispSwap_Color4dv",
+ "__glXDispSwap_Color4fv",
+ "__glXDispSwap_Color4iv",
+ "__glXDispSwap_Color4sv",
+ "__glXDispSwap_Color4ubv",
+ "__glXDispSwap_Color4uiv",
+ "__glXDispSwap_Color4usv",
+ "__glXDispSwap_ColorMask",
+ "__glXDispSwap_ColorMaterial",
+ "__glXDispSwap_ColorSubTable",
+ "__glXDispSwap_ColorTable",
+ "__glXDispSwap_ColorTableParameterfv",
+ "__glXDispSwap_ColorTableParameteriv",
+ "__glXDispSwap_ConvolutionFilter1D",
+ "__glXDispSwap_ConvolutionFilter2D",
+ "__glXDispSwap_ConvolutionParameterf",
+ "__glXDispSwap_ConvolutionParameterfv",
+ "__glXDispSwap_ConvolutionParameteri",
+ "__glXDispSwap_ConvolutionParameteriv",
+ "__glXDispSwap_CopyColorSubTable",
+ "__glXDispSwap_CopyColorTable",
+ "__glXDispSwap_CopyConvolutionFilter1D",
+ "__glXDispSwap_CopyConvolutionFilter2D",
+ "__glXDispSwap_CopyPixels",
+ "__glXDispSwap_CopyTexImage1D",
+ "__glXDispSwap_CopyTexImage2D",
+ "__glXDispSwap_CopyTexSubImage1D",
+ "__glXDispSwap_CopyTexSubImage2D",
+ "__glXDispSwap_CopyTexSubImage3D",
+ "__glXDispSwap_CullFace",
+ "__glXDispSwap_DeleteLists",
+ "__glXDispSwap_DeleteTextures",
+ "__glXDispSwap_DeleteTexturesEXT",
+ "__glXDispSwap_DepthFunc",
+ "__glXDispSwap_DepthMask",
+ "__glXDispSwap_DepthRange",
+ "__glXDispSwap_Disable",
+ "__glXDispSwap_DrawArrays",
+ "__glXDispSwap_DrawArraysEXT",
+ "__glXDispSwap_DrawBuffer",
+ "__glXDispSwap_DrawPixels",
+ "__glXDispSwap_EdgeFlagv",
+ "__glXDispSwap_Enable",
+ "__glXDispSwap_End",
+ "__glXDispSwap_EndList",
+ "__glXDispSwap_EvalCoord1dv",
+ "__glXDispSwap_EvalCoord1fv",
+ "__glXDispSwap_EvalCoord2dv",
+ "__glXDispSwap_EvalCoord2fv",
+ "__glXDispSwap_EvalMesh1",
+ "__glXDispSwap_EvalMesh2",
+ "__glXDispSwap_EvalPoint1",
+ "__glXDispSwap_EvalPoint2",
+ "__glXDispSwap_FeedbackBuffer",
+ "__glXDispSwap_Finish",
+ "__glXDispSwap_Flush",
+ "__glXDispSwap_Fogf",
+ "__glXDispSwap_Fogfv",
+ "__glXDispSwap_Fogi",
+ "__glXDispSwap_Fogiv",
+ "__glXDispSwap_FrontFace",
+ "__glXDispSwap_Frustum",
+ "__glXDispSwap_GenLists",
+ "__glXDispSwap_GenTextures",
+ "__glXDispSwap_GenTexturesEXT",
+ "__glXDispSwap_GetBooleanv",
+ "__glXDispSwap_GetClipPlane",
+ "__glXDispSwap_GetColorTable",
+ "__glXDispSwap_GetColorTableParameterfv",
+ "__glXDispSwap_GetColorTableParameteriv",
+ "__glXDispSwap_GetConvolutionFilter",
+ "__glXDispSwap_GetConvolutionParameterfv",
+ "__glXDispSwap_GetConvolutionParameteriv",
+ "__glXDispSwap_GetDoublev",
+ "__glXDispSwap_GetError",
+ "__glXDispSwap_GetFloatv",
+ "__glXDispSwap_GetHistogram",
+ "__glXDispSwap_GetHistogramParameterfv",
+ "__glXDispSwap_GetHistogramParameteriv",
+ "__glXDispSwap_GetIntegerv",
+ "__glXDispSwap_GetLightfv",
+ "__glXDispSwap_GetLightiv",
+ "__glXDispSwap_GetMapdv",
+ "__glXDispSwap_GetMapfv",
+ "__glXDispSwap_GetMapiv",
+ "__glXDispSwap_GetMaterialfv",
+ "__glXDispSwap_GetMaterialiv",
+ "__glXDispSwap_GetMinmax",
+ "__glXDispSwap_GetMinmaxParameterfv",
+ "__glXDispSwap_GetMinmaxParameteriv",
+ "__glXDispSwap_GetPixelMapfv",
+ "__glXDispSwap_GetPixelMapuiv",
+ "__glXDispSwap_GetPixelMapusv",
+ "__glXDispSwap_GetPolygonStipple",
+ "__glXDispSwap_GetSeparableFilter",
+ "__glXDispSwap_GetString",
+ "__glXDispSwap_GetTexEnvfv",
+ "__glXDispSwap_GetTexEnviv",
+ "__glXDispSwap_GetTexGendv",
+ "__glXDispSwap_GetTexGenfv",
+ "__glXDispSwap_GetTexGeniv",
+ "__glXDispSwap_GetTexImage",
+ "__glXDispSwap_GetTexLevelParameterfv",
+ "__glXDispSwap_GetTexLevelParameteriv",
+ "__glXDispSwap_GetTexParameterfv",
+ "__glXDispSwap_GetTexParameteriv",
+ "__glXDispSwap_Hint",
+ "__glXDispSwap_Histogram",
+ "__glXDispSwap_IndexMask",
+ "__glXDispSwap_Indexdv",
+ "__glXDispSwap_Indexfv",
+ "__glXDispSwap_Indexiv",
+ "__glXDispSwap_Indexsv",
+ "__glXDispSwap_Indexubv",
+ "__glXDispSwap_InitNames",
+ "__glXDispSwap_IsEnabled",
+ "__glXDispSwap_IsList",
+ "__glXDispSwap_IsTexture",
+ "__glXDispSwap_IsTextureEXT",
+ "__glXDispSwap_LightModelf",
+ "__glXDispSwap_LightModelfv",
+ "__glXDispSwap_LightModeli",
+ "__glXDispSwap_LightModeliv",
+ "__glXDispSwap_Lightf",
+ "__glXDispSwap_Lightfv",
+ "__glXDispSwap_Lighti",
+ "__glXDispSwap_Lightiv",
+ "__glXDispSwap_LineStipple",
+ "__glXDispSwap_LineWidth",
+ "__glXDispSwap_ListBase",
+ "__glXDispSwap_LoadIdentity",
+ "__glXDispSwap_LoadMatrixd",
+ "__glXDispSwap_LoadMatrixf",
+ "__glXDispSwap_LoadName",
+ "__glXDispSwap_LogicOp",
+ "__glXDispSwap_Map1d",
+ "__glXDispSwap_Map1f",
+ "__glXDispSwap_Map2d",
+ "__glXDispSwap_Map2f",
+ "__glXDispSwap_MapGrid1d",
+ "__glXDispSwap_MapGrid1f",
+ "__glXDispSwap_MapGrid2d",
+ "__glXDispSwap_MapGrid2f",
+ "__glXDispSwap_Materialf",
+ "__glXDispSwap_Materialfv",
+ "__glXDispSwap_Materiali",
+ "__glXDispSwap_Materialiv",
+ "__glXDispSwap_MatrixMode",
+ "__glXDispSwap_Minmax",
+ "__glXDispSwap_MultMatrixd",
+ "__glXDispSwap_MultMatrixf",
+ "__glXDispSwap_MultiTexCoord1dvARB",
+ "__glXDispSwap_MultiTexCoord1fvARB",
+ "__glXDispSwap_MultiTexCoord1ivARB",
+ "__glXDispSwap_MultiTexCoord1svARB",
+ "__glXDispSwap_MultiTexCoord2dvARB",
+ "__glXDispSwap_MultiTexCoord2fvARB",
+ "__glXDispSwap_MultiTexCoord2ivARB",
+ "__glXDispSwap_MultiTexCoord2svARB",
+ "__glXDispSwap_MultiTexCoord3dvARB",
+ "__glXDispSwap_MultiTexCoord3fvARB",
+ "__glXDispSwap_MultiTexCoord3ivARB",
+ "__glXDispSwap_MultiTexCoord3svARB",
+ "__glXDispSwap_MultiTexCoord4dvARB",
+ "__glXDispSwap_MultiTexCoord4fvARB",
+ "__glXDispSwap_MultiTexCoord4ivARB",
+ "__glXDispSwap_MultiTexCoord4svARB",
+ "__glXDispSwap_NewList",
+ "__glXDispSwap_Normal3bv",
+ "__glXDispSwap_Normal3dv",
+ "__glXDispSwap_Normal3fv",
+ "__glXDispSwap_Normal3iv",
+ "__glXDispSwap_Normal3sv",
+ "__glXDispSwap_Ortho",
+ "__glXDispSwap_PassThrough",
+ "__glXDispSwap_PixelMapfv",
+ "__glXDispSwap_PixelMapuiv",
+ "__glXDispSwap_PixelMapusv",
+ "__glXDispSwap_PixelStoref",
+ "__glXDispSwap_PixelStorei",
+ "__glXDispSwap_PixelTransferf",
+ "__glXDispSwap_PixelTransferi",
+ "__glXDispSwap_PixelZoom",
+ "__glXDispSwap_PointParameterfARB",
+ "__glXDispSwap_PointParameterfvARB",
+ "__glXDispSwap_PointSize",
+ "__glXDispSwap_PolygonMode",
+ "__glXDispSwap_PolygonOffset",
+ "__glXDispSwap_PolygonStipple",
+ "__glXDispSwap_PopAttrib",
+ "__glXDispSwap_PopMatrix",
+ "__glXDispSwap_PopName",
+ "__glXDispSwap_PrioritizeTextures",
+ "__glXDispSwap_PushAttrib",
+ "__glXDispSwap_PushMatrix",
+ "__glXDispSwap_PushName",
+ "__glXDispSwap_RasterPos2dv",
+ "__glXDispSwap_RasterPos2fv",
+ "__glXDispSwap_RasterPos2iv",
+ "__glXDispSwap_RasterPos2sv",
+ "__glXDispSwap_RasterPos3dv",
+ "__glXDispSwap_RasterPos3fv",
+ "__glXDispSwap_RasterPos3iv",
+ "__glXDispSwap_RasterPos3sv",
+ "__glXDispSwap_RasterPos4dv",
+ "__glXDispSwap_RasterPos4fv",
+ "__glXDispSwap_RasterPos4iv",
+ "__glXDispSwap_RasterPos4sv",
+ "__glXDispSwap_ReadBuffer",
+ "__glXDispSwap_ReadPixels",
+ "__glXDispSwap_Rectdv",
+ "__glXDispSwap_Rectfv",
+ "__glXDispSwap_Rectiv",
+ "__glXDispSwap_Rectsv",
+ "__glXDispSwap_RenderMode",
+ "__glXDispSwap_ResetHistogram",
+ "__glXDispSwap_ResetMinmax",
+ "__glXDispSwap_Rotated",
+ "__glXDispSwap_Rotatef",
+ "__glXDispSwap_Scaled",
+ "__glXDispSwap_Scalef",
+ "__glXDispSwap_Scissor",
+ "__glXDispSwap_SelectBuffer",
+ "__glXDispSwap_SeparableFilter2D",
+ "__glXDispSwap_ShadeModel",
+ "__glXDispSwap_StencilFunc",
+ "__glXDispSwap_StencilMask",
+ "__glXDispSwap_StencilOp",
+ "__glXDispSwap_TexCoord1dv",
+ "__glXDispSwap_TexCoord1fv",
+ "__glXDispSwap_TexCoord1iv",
+ "__glXDispSwap_TexCoord1sv",
+ "__glXDispSwap_TexCoord2dv",
+ "__glXDispSwap_TexCoord2fv",
+ "__glXDispSwap_TexCoord2iv",
+ "__glXDispSwap_TexCoord2sv",
+ "__glXDispSwap_TexCoord3dv",
+ "__glXDispSwap_TexCoord3fv",
+ "__glXDispSwap_TexCoord3iv",
+ "__glXDispSwap_TexCoord3sv",
+ "__glXDispSwap_TexCoord4dv",
+ "__glXDispSwap_TexCoord4fv",
+ "__glXDispSwap_TexCoord4iv",
+ "__glXDispSwap_TexCoord4sv",
+ "__glXDispSwap_TexEnvf",
+ "__glXDispSwap_TexEnvfv",
+ "__glXDispSwap_TexEnvi",
+ "__glXDispSwap_TexEnviv",
+ "__glXDispSwap_TexGend",
+ "__glXDispSwap_TexGendv",
+ "__glXDispSwap_TexGenf",
+ "__glXDispSwap_TexGenfv",
+ "__glXDispSwap_TexGeni",
+ "__glXDispSwap_TexGeniv",
+ "__glXDispSwap_TexImage1D",
+ "__glXDispSwap_TexImage2D",
+ "__glXDispSwap_TexImage3D",
+ "__glXDispSwap_TexParameterf",
+ "__glXDispSwap_TexParameterfv",
+ "__glXDispSwap_TexParameteri",
+ "__glXDispSwap_TexParameteriv",
+ "__glXDispSwap_TexSubImage1D",
+ "__glXDispSwap_TexSubImage2D",
+ "__glXDispSwap_TexSubImage3D",
+ "__glXDispSwap_Translated",
+ "__glXDispSwap_Translatef",
+ "__glXDispSwap_Vertex2dv",
+ "__glXDispSwap_Vertex2fv",
+ "__glXDispSwap_Vertex2iv",
+ "__glXDispSwap_Vertex2sv",
+ "__glXDispSwap_Vertex3dv",
+ "__glXDispSwap_Vertex3fv",
+ "__glXDispSwap_Vertex3iv",
+ "__glXDispSwap_Vertex3sv",
+ "__glXDispSwap_Vertex4dv",
+ "__glXDispSwap_Vertex4fv",
+ "__glXDispSwap_Vertex4iv",
+ "__glXDispSwap_Vertex4sv",
+ "__glXDispSwap_Viewport",
+ "__glXDispSwap_WindowPos3fARB",
+ "__glXDisp_Accum",
+ "__glXDisp_ActiveStencilFaceEXT",
+ "__glXDisp_ActiveTextureARB",
+ "__glXDisp_AlphaFunc",
+ "__glXDisp_AreTexturesResident",
+ "__glXDisp_AreTexturesResidentEXT",
+ "__glXDisp_Begin",
+ "__glXDisp_BindTexture",
+ "__glXDisp_Bitmap",
+ "__glXDisp_BlendColor",
+ "__glXDisp_BlendEquation",
+ "__glXDisp_BlendFunc",
+ "__glXDisp_CallList",
+ "__glXDisp_CallLists",
+ "__glXDisp_Clear",
+ "__glXDisp_ClearAccum",
+ "__glXDisp_ClearColor",
+ "__glXDisp_ClearDepth",
+ "__glXDisp_ClearIndex",
+ "__glXDisp_ClearStencil",
+ "__glXDisp_ClipPlane",
+ "__glXDisp_Color3bv",
+ "__glXDisp_Color3dv",
+ "__glXDisp_Color3fv",
+ "__glXDisp_Color3iv",
+ "__glXDisp_Color3sv",
+ "__glXDisp_Color3ubv",
+ "__glXDisp_Color3uiv",
+ "__glXDisp_Color3usv",
+ "__glXDisp_Color4bv",
+ "__glXDisp_Color4dv",
+ "__glXDisp_Color4fv",
+ "__glXDisp_Color4iv",
+ "__glXDisp_Color4sv",
+ "__glXDisp_Color4ubv",
+ "__glXDisp_Color4uiv",
+ "__glXDisp_Color4usv",
+ "__glXDisp_ColorMask",
+ "__glXDisp_ColorMaterial",
+ "__glXDisp_ColorSubTable",
+ "__glXDisp_ColorTable",
+ "__glXDisp_ColorTableParameterfv",
+ "__glXDisp_ColorTableParameteriv",
+ "__glXDisp_ConvolutionFilter1D",
+ "__glXDisp_ConvolutionFilter2D",
+ "__glXDisp_ConvolutionParameterf",
+ "__glXDisp_ConvolutionParameterfv",
+ "__glXDisp_ConvolutionParameteri",
+ "__glXDisp_ConvolutionParameteriv",
+ "__glXDisp_CopyColorSubTable",
+ "__glXDisp_CopyColorTable",
+ "__glXDisp_CopyConvolutionFilter1D",
+ "__glXDisp_CopyConvolutionFilter2D",
+ "__glXDisp_CopyPixels",
+ "__glXDisp_CopyTexImage1D",
+ "__glXDisp_CopyTexImage2D",
+ "__glXDisp_CopyTexSubImage1D",
+ "__glXDisp_CopyTexSubImage2D",
+ "__glXDisp_CopyTexSubImage3D",
+ "__glXDisp_CullFace",
+ "__glXDisp_DeleteLists",
+ "__glXDisp_DeleteTextures",
+ "__glXDisp_DeleteTexturesEXT",
+ "__glXDisp_DepthFunc",
+ "__glXDisp_DepthMask",
+ "__glXDisp_DepthRange",
+ "__glXDisp_Disable",
+ "__glXDisp_DrawArrays",
+ "__glXDisp_DrawArraysEXT",
+ "__glXDisp_DrawBuffer",
+ "__glXDisp_DrawPixels",
+ "__glXDisp_EdgeFlagv",
+ "__glXDisp_Enable",
+ "__glXDisp_End",
+ "__glXDisp_EndList",
+ "__glXDisp_EvalCoord1dv",
+ "__glXDisp_EvalCoord1fv",
+ "__glXDisp_EvalCoord2dv",
+ "__glXDisp_EvalCoord2fv",
+ "__glXDisp_EvalMesh1",
+ "__glXDisp_EvalMesh2",
+ "__glXDisp_EvalPoint1",
+ "__glXDisp_EvalPoint2",
+ "__glXDisp_FeedbackBuffer",
+ "__glXDisp_Finish",
+ "__glXDisp_Flush",
+ "__glXDisp_Fogf",
+ "__glXDisp_Fogfv",
+ "__glXDisp_Fogi",
+ "__glXDisp_Fogiv",
+ "__glXDisp_FrontFace",
+ "__glXDisp_Frustum",
+ "__glXDisp_GenLists",
+ "__glXDisp_GenTextures",
+ "__glXDisp_GenTexturesEXT",
+ "__glXDisp_GetBooleanv",
+ "__glXDisp_GetClipPlane",
+ "__glXDisp_GetColorTable",
+ "__glXDisp_GetColorTableParameterfv",
+ "__glXDisp_GetColorTableParameteriv",
+ "__glXDisp_GetConvolutionFilter",
+ "__glXDisp_GetConvolutionParameterfv",
+ "__glXDisp_GetConvolutionParameteriv",
+ "__glXDisp_GetDoublev",
+ "__glXDisp_GetError",
+ "__glXDisp_GetFloatv",
+ "__glXDisp_GetHistogram",
+ "__glXDisp_GetHistogramParameterfv",
+ "__glXDisp_GetHistogramParameteriv",
+ "__glXDisp_GetIntegerv",
+ "__glXDisp_GetLightfv",
+ "__glXDisp_GetLightiv",
+ "__glXDisp_GetMapdv",
+ "__glXDisp_GetMapfv",
+ "__glXDisp_GetMapiv",
+ "__glXDisp_GetMaterialfv",
+ "__glXDisp_GetMaterialiv",
+ "__glXDisp_GetMinmax",
+ "__glXDisp_GetMinmaxParameterfv",
+ "__glXDisp_GetMinmaxParameteriv",
+ "__glXDisp_GetPixelMapfv",
+ "__glXDisp_GetPixelMapuiv",
+ "__glXDisp_GetPixelMapusv",
+ "__glXDisp_GetPolygonStipple",
+ "__glXDisp_GetSeparableFilter",
+ "__glXDisp_GetString",
+ "__glXDisp_GetTexEnvfv",
+ "__glXDisp_GetTexEnviv",
+ "__glXDisp_GetTexGendv",
+ "__glXDisp_GetTexGenfv",
+ "__glXDisp_GetTexGeniv",
+ "__glXDisp_GetTexImage",
+ "__glXDisp_GetTexLevelParameterfv",
+ "__glXDisp_GetTexLevelParameteriv",
+ "__glXDisp_GetTexParameterfv",
+ "__glXDisp_GetTexParameteriv",
+ "__glXDisp_Hint",
+ "__glXDisp_Histogram",
+ "__glXDisp_IndexMask",
+ "__glXDisp_Indexdv",
+ "__glXDisp_Indexfv",
+ "__glXDisp_Indexiv",
+ "__glXDisp_Indexsv",
+ "__glXDisp_Indexubv",
+ "__glXDisp_InitNames",
+ "__glXDisp_IsEnabled",
+ "__glXDisp_IsList",
+ "__glXDisp_IsTexture",
+ "__glXDisp_IsTextureEXT",
+ "__glXDisp_LightModelf",
+ "__glXDisp_LightModelfv",
+ "__glXDisp_LightModeli",
+ "__glXDisp_LightModeliv",
+ "__glXDisp_Lightf",
+ "__glXDisp_Lightfv",
+ "__glXDisp_Lighti",
+ "__glXDisp_Lightiv",
+ "__glXDisp_LineStipple",
+ "__glXDisp_LineWidth",
+ "__glXDisp_ListBase",
+ "__glXDisp_LoadIdentity",
+ "__glXDisp_LoadMatrixd",
+ "__glXDisp_LoadMatrixf",
+ "__glXDisp_LoadName",
+ "__glXDisp_LogicOp",
+ "__glXDisp_Map1d",
+ "__glXDisp_Map1f",
+ "__glXDisp_Map2d",
+ "__glXDisp_Map2f",
+ "__glXDisp_MapGrid1d",
+ "__glXDisp_MapGrid1f",
+ "__glXDisp_MapGrid2d",
+ "__glXDisp_MapGrid2f",
+ "__glXDisp_Materialf",
+ "__glXDisp_Materialfv",
+ "__glXDisp_Materiali",
+ "__glXDisp_Materialiv",
+ "__glXDisp_MatrixMode",
+ "__glXDisp_Minmax",
+ "__glXDisp_MultMatrixd",
+ "__glXDisp_MultMatrixf",
+ "__glXDisp_MultiTexCoord1dvARB",
+ "__glXDisp_MultiTexCoord1fvARB",
+ "__glXDisp_MultiTexCoord1ivARB",
+ "__glXDisp_MultiTexCoord1svARB",
+ "__glXDisp_MultiTexCoord2dvARB",
+ "__glXDisp_MultiTexCoord2fvARB",
+ "__glXDisp_MultiTexCoord2ivARB",
+ "__glXDisp_MultiTexCoord2svARB",
+ "__glXDisp_MultiTexCoord3dvARB",
+ "__glXDisp_MultiTexCoord3fvARB",
+ "__glXDisp_MultiTexCoord3ivARB",
+ "__glXDisp_MultiTexCoord3svARB",
+ "__glXDisp_MultiTexCoord4dvARB",
+ "__glXDisp_MultiTexCoord4fvARB",
+ "__glXDisp_MultiTexCoord4ivARB",
+ "__glXDisp_MultiTexCoord4svARB",
+ "__glXDisp_NewList",
+ "__glXDisp_Normal3bv",
+ "__glXDisp_Normal3dv",
+ "__glXDisp_Normal3fv",
+ "__glXDisp_Normal3iv",
+ "__glXDisp_Normal3sv",
+ "__glXDisp_Ortho",
+ "__glXDisp_PassThrough",
+ "__glXDisp_PixelMapfv",
+ "__glXDisp_PixelMapuiv",
+ "__glXDisp_PixelMapusv",
+ "__glXDisp_PixelStoref",
+ "__glXDisp_PixelStorei",
+ "__glXDisp_PixelTransferf",
+ "__glXDisp_PixelTransferi",
+ "__glXDisp_PixelZoom",
+ "__glXDisp_PointParameterfARB",
+ "__glXDisp_PointParameterfvARB",
+ "__glXDisp_PointSize",
+ "__glXDisp_PolygonMode",
+ "__glXDisp_PolygonOffset",
+ "__glXDisp_PolygonStipple",
+ "__glXDisp_PopAttrib",
+ "__glXDisp_PopMatrix",
+ "__glXDisp_PopName",
+ "__glXDisp_PrioritizeTextures",
+ "__glXDisp_PushAttrib",
+ "__glXDisp_PushMatrix",
+ "__glXDisp_PushName",
+ "__glXDisp_RasterPos2dv",
+ "__glXDisp_RasterPos2fv",
+ "__glXDisp_RasterPos2iv",
+ "__glXDisp_RasterPos2sv",
+ "__glXDisp_RasterPos3dv",
+ "__glXDisp_RasterPos3fv",
+ "__glXDisp_RasterPos3iv",
+ "__glXDisp_RasterPos3sv",
+ "__glXDisp_RasterPos4dv",
+ "__glXDisp_RasterPos4fv",
+ "__glXDisp_RasterPos4iv",
+ "__glXDisp_RasterPos4sv",
+ "__glXDisp_ReadBuffer",
+ "__glXDisp_ReadPixels",
+ "__glXDisp_Rectdv",
+ "__glXDisp_Rectfv",
+ "__glXDisp_Rectiv",
+ "__glXDisp_Rectsv",
+ "__glXDisp_RenderMode",
+ "__glXDisp_ResetHistogram",
+ "__glXDisp_ResetMinmax",
+ "__glXDisp_Rotated",
+ "__glXDisp_Rotatef",
+ "__glXDisp_Scaled",
+ "__glXDisp_Scalef",
+ "__glXDisp_Scissor",
+ "__glXDisp_SelectBuffer",
+ "__glXDisp_SeparableFilter2D",
+ "__glXDisp_ShadeModel",
+ "__glXDisp_StencilFunc",
+ "__glXDisp_StencilMask",
+ "__glXDisp_StencilOp",
+ "__glXDisp_TexCoord1dv",
+ "__glXDisp_TexCoord1fv",
+ "__glXDisp_TexCoord1iv",
+ "__glXDisp_TexCoord1sv",
+ "__glXDisp_TexCoord2dv",
+ "__glXDisp_TexCoord2fv",
+ "__glXDisp_TexCoord2iv",
+ "__glXDisp_TexCoord2sv",
+ "__glXDisp_TexCoord3dv",
+ "__glXDisp_TexCoord3fv",
+ "__glXDisp_TexCoord3iv",
+ "__glXDisp_TexCoord3sv",
+ "__glXDisp_TexCoord4dv",
+ "__glXDisp_TexCoord4fv",
+ "__glXDisp_TexCoord4iv",
+ "__glXDisp_TexCoord4sv",
+ "__glXDisp_TexEnvf",
+ "__glXDisp_TexEnvfv",
+ "__glXDisp_TexEnvi",
+ "__glXDisp_TexEnviv",
+ "__glXDisp_TexGend",
+ "__glXDisp_TexGendv",
+ "__glXDisp_TexGenf",
+ "__glXDisp_TexGenfv",
+ "__glXDisp_TexGeni",
+ "__glXDisp_TexGeniv",
+ "__glXDisp_TexImage1D",
+ "__glXDisp_TexImage2D",
+ "__glXDisp_TexImage3D",
+ "__glXDisp_TexParameterf",
+ "__glXDisp_TexParameterfv",
+ "__glXDisp_TexParameteri",
+ "__glXDisp_TexParameteriv",
+ "__glXDisp_TexSubImage1D",
+ "__glXDisp_TexSubImage2D",
+ "__glXDisp_TexSubImage3D",
+ "__glXDisp_Translated",
+ "__glXDisp_Translatef",
+ "__glXDisp_Vertex2dv",
+ "__glXDisp_Vertex2fv",
+ "__glXDisp_Vertex2iv",
+ "__glXDisp_Vertex2sv",
+ "__glXDisp_Vertex3dv",
+ "__glXDisp_Vertex3fv",
+ "__glXDisp_Vertex3iv",
+ "__glXDisp_Vertex3sv",
+ "__glXDisp_Vertex4dv",
+ "__glXDisp_Vertex4fv",
+ "__glXDisp_Vertex4iv",
+ "__glXDisp_Vertex4sv",
+ "__glXDisp_Viewport",
+ "__glXDisp_WindowPos3fARB",
+ "__glXDrawArraysSize",
+ "__glXDrawPixelsReqSize",
+ "__glXDrawableRes",
+ "__glXErrorOccured",
+ "__glXFBInitDrawable",
+ "__glXFBMemSwapBuffers",
+ "__glXFindDrawablePrivate",
+ "__glXFogfvReqSize",
+ "__glXFogivReqSize",
+ "__glXForceCurrent",
+ "__glXFree",
+ "__glXFreeBuffers",
+ "__glXFreeContext",
+ "__glXGetDrawablePrivate",
+ "__glXGetVisualConfigs",
+ "__glXImageSize",
+ "__glXImpAtoi",
+ "__glXImpCalloc",
+ "__glXImpFatal",
+ "__glXImpFclose",
+ "__glXImpFopen",
+ "__glXImpFprintf",
+ "__glXImpFree",
+ "__glXImpGetDrawablePrivate",
+ "__glXImpGetenv",
+ "__glXImpMalloc",
+ "__glXImpRealloc",
+ "__glXImpSprintf",
+ "__glXImpWarning",
+ "__glXInitFB",
+ "__glXInitMem",
+ "__glXInitPix",
+ "__glXIsDirect",
+ "__glXLastContext",
+ "__glXLightModelfvReqSize",
+ "__glXLightModelivReqSize",
+ "__glXLightfvReqSize",
+ "__glXLightivReqSize",
+ "__glXLookupContextByTag",
+ "__glXMakeCurrent",
+ "__glXMalloc",
+ "__glXMap1dReqSize",
+ "__glXMap1fReqSize",
+ "__glXMap2dReqSize",
+ "__glXMap2fReqSize",
+ "__glXMaterialfvReqSize",
+ "__glXMaterialivReqSize",
+ "__glXNoSuchRenderOpcode",
+ "__glXNoSuchSingleOpcode",
+ "__glXNop",
+ "__glXPixInitDrawable",
+ "__glXPixelMapfvReqSize",
+ "__glXPixelMapuivReqSize",
+ "__glXPixelMapusvReqSize",
+ "__glXPixmapRes",
+ "__glXPrioritizeTexturesReqSize",
+ "__glXQueryContextInfoEXT",
+ "__glXQueryExtensionsString",
+ "__glXQueryServerString",
+ "__glXQueryVersion",
+ "__glXRealloc",
+ "__glXRender",
+ "__glXRenderLarge",
+ "__glXRenderSizeTable",
+ "__glXRenderSizeTable_EXT",
+ "__glXRenderTable",
+ "__glXRenderTable_EXT",
+ "__glXReply",
+ "__glXResetLargeCommandStatus",
+ "__glXResizeBuffers",
+ "__glXResizeDrawableBuffers",
+ "__glXScreenInit",
+ "__glXScreenReset",
+ "__glXSeparableFilter2DReqSize",
+ "__glXSingleTable",
+ "__glXSwapBuffers",
+ "__glXSwapClientInfo",
+ "__glXSwapCopyContext",
+ "__glXSwapCreateContext",
+ "__glXSwapCreateGLXPixmap",
+ "__glXSwapDestroyContext",
+ "__glXSwapDestroyGLXPixmap",
+ "__glXSwapGetVisualConfigs",
+ "__glXSwapIsDirect",
+ "__glXSwapIsDirectReply",
+ "__glXSwapMakeCurrent",
+ "__glXSwapMakeCurrentReply",
+ "__glXSwapQueryContextInfoEXTReply",
+ "__glXSwapQueryExtensionsString",
+ "__glXSwapQueryServerString",
+ "__glXSwapQueryVersion",
+ "__glXSwapQueryVersionReply",
+ "__glXSwapRender",
+ "__glXSwapRenderLarge",
+ "__glXSwapRenderTable",
+ "__glXSwapRenderTable_EXT",
+ "__glXSwapSingleTable",
+ "__glXSwapSwapBuffers",
+ "__glXSwapUseXFont",
+ "__glXSwapVendorPrivTable_EXT",
+ "__glXSwapVendorPrivate",
+ "__glXSwapVendorPrivateWithReply",
+ "__glXSwapWaitGL",
+ "__glXSwapWaitX",
+ "__glXTexEnvfvReqSize",
+ "__glXTexEnvivReqSize",
+ "__glXTexGendvReqSize",
+ "__glXTexGenfvReqSize",
+ "__glXTexGenivReqSize",
+ "__glXTexImage1DReqSize",
+ "__glXTexImage2DReqSize",
+ "__glXTexImage3DReqSize",
+ "__glXTexParameterfvReqSize",
+ "__glXTexParameterivReqSize",
+ "__glXTexSubImage1DReqSize",
+ "__glXTexSubImage2DReqSize",
+ "__glXTexSubImage3DReqSize",
+ "__glXTypeSize",
+ "__glXUnrefDrawablePrivate",
+ "__glXUnsupportedPrivateRequest",
+ "__glXUseXFont",
+ "__glXVendorPrivTable_EXT",
+ "__glXVendorPrivate",
+ "__glXVendorPrivateWithReply",
+ "__glXWaitGL",
+ "__glXWaitX",
+ "__glXcombine_strings",
+ "glAccum",
+ "glActiveStencilFaceEXT",
+ "glActiveTextureARB",
+ "glAlphaFunc",
+ "glAreTexturesResident",
+ "glAreTexturesResidentEXT",
+ "glBegin",
+ "glBindTexture",
+ "glBitmap",
+ "glBlendColor",
+ "glBlendEquation",
+ "glBlendFunc",
+ "glCallList",
+ "glCallLists",
+ "glClear",
+ "glClearAccum",
+ "glClearColor",
+ "glClearDepth",
+ "glClearIndex",
+ "glClearStencil",
+ "glClipPlane",
+ "glColor3bv",
+ "glColor3dv",
+ "glColor3fv",
+ "glColor3iv",
+ "glColor3sv",
+ "glColor3ubv",
+ "glColor3uiv",
+ "glColor3usv",
+ "glColor4bv",
+ "glColor4dv",
+ "glColor4fv",
+ "glColor4iv",
+ "glColor4sv",
+ "glColor4ubv",
+ "glColor4uiv",
+ "glColor4usv",
+ "glColorMask",
+ "glColorMaterial",
+ "glColorPointer",
+ "glColorSubTable",
+ "glColorTable",
+ "glColorTableParameterfv",
+ "glColorTableParameteriv",
+ "glConvolutionFilter1D",
+ "glConvolutionFilter2D",
+ "glConvolutionParameterf",
+ "glConvolutionParameterfv",
+ "glConvolutionParameteri",
+ "glConvolutionParameteriv",
+ "glCopyColorSubTable",
+ "glCopyColorTable",
+ "glCopyConvolutionFilter1D",
+ "glCopyConvolutionFilter2D",
+ "glCopyPixels",
+ "glCopyTexImage1D",
+ "glCopyTexImage2D",
+ "glCopyTexSubImage1D",
+ "glCopyTexSubImage2D",
+ "glCopyTexSubImage3D",
+ "glCullFace",
+ "glDeleteLists",
+ "glDeleteTextures",
+ "glDeleteTexturesEXT",
+ "glDepthFunc",
+ "glDepthMask",
+ "glDepthRange",
+ "glDisable",
+ "glDisableClientState",
+ "glDrawArrays",
+ "glDrawBuffer",
+ "glDrawPixels",
+ "glEdgeFlagPointer",
+ "glEdgeFlagv",
+ "glEnable",
+ "glEnableClientState",
+ "glEnd",
+ "glEndList",
+ "glEvalCoord1dv",
+ "glEvalCoord1fv",
+ "glEvalCoord2dv",
+ "glEvalCoord2fv",
+ "glEvalMesh1",
+ "glEvalMesh2",
+ "glEvalPoint1",
+ "glEvalPoint2",
+ "glFeedbackBuffer",
+ "glFinish",
+ "glFlush",
+ "glFogf",
+ "glFogfv",
+ "glFogi",
+ "glFogiv",
+ "glFrontFace",
+ "glFrustum",
+ "glGenLists",
+ "glGenTextures",
+ "glGenTexturesEXT",
+ "glGetBooleanv",
+ "glGetClipPlane",
+ "glGetColorTable",
+ "glGetColorTableParameterfv",
+ "glGetColorTableParameteriv",
+ "glGetConvolutionFilter",
+ "glGetConvolutionParameterfv",
+ "glGetConvolutionParameteriv",
+ "glGetDoublev",
+ "glGetError",
+ "glGetFloatv",
+ "glGetHistogram",
+ "glGetHistogramParameterfv",
+ "glGetHistogramParameteriv",
+ "glGetIntegerv",
+ "glGetLightfv",
+ "glGetLightiv",
+ "glGetMapdv",
+ "glGetMapfv",
+ "glGetMapiv",
+ "glGetMaterialfv",
+ "glGetMaterialiv",
+ "glGetMinmax",
+ "glGetMinmaxParameterfv",
+ "glGetMinmaxParameteriv",
+ "glGetPixelMapfv",
+ "glGetPixelMapuiv",
+ "glGetPixelMapusv",
+ "glGetPolygonStipple",
+ "glGetSeparableFilter",
+ "glGetString",
+ "glGetTexEnvfv",
+ "glGetTexEnviv",
+ "glGetTexGendv",
+ "glGetTexGenfv",
+ "glGetTexGeniv",
+ "glGetTexImage",
+ "glGetTexLevelParameterfv",
+ "glGetTexLevelParameteriv",
+ "glGetTexParameterfv",
+ "glGetTexParameteriv",
+ "glHint",
+ "glHistogram",
+ "glIndexMask",
+ "glIndexPointer",
+ "glIndexdv",
+ "glIndexfv",
+ "glIndexiv",
+ "glIndexsv",
+ "glIndexubv",
+ "glInitNames",
+ "glIsEnabled",
+ "glIsList",
+ "glIsTexture",
+ "glIsTextureEXT",
+ "glLightModelf",
+ "glLightModelfv",
+ "glLightModeli",
+ "glLightModeliv",
+ "glLightf",
+ "glLightfv",
+ "glLighti",
+ "glLightiv",
+ "glLineStipple",
+ "glLineWidth",
+ "glListBase",
+ "glLoadIdentity",
+ "glLoadMatrixd",
+ "glLoadMatrixf",
+ "glLoadName",
+ "glLogicOp",
+ "glMap1d",
+ "glMap1f",
+ "glMap2d",
+ "glMap2f",
+ "glMapGrid1d",
+ "glMapGrid1f",
+ "glMapGrid2d",
+ "glMapGrid2f",
+ "glMaterialf",
+ "glMaterialfv",
+ "glMateriali",
+ "glMaterialiv",
+ "glMatrixMode",
+ "glMinmax",
+ "glMultMatrixd",
+ "glMultMatrixf",
+ "glMultiTexCoord1dvARB",
+ "glMultiTexCoord1fvARB",
+ "glMultiTexCoord1ivARB",
+ "glMultiTexCoord1svARB",
+ "glMultiTexCoord2dvARB",
+ "glMultiTexCoord2fvARB",
+ "glMultiTexCoord2ivARB",
+ "glMultiTexCoord2svARB",
+ "glMultiTexCoord3dvARB",
+ "glMultiTexCoord3fvARB",
+ "glMultiTexCoord3ivARB",
+ "glMultiTexCoord3svARB",
+ "glMultiTexCoord4dvARB",
+ "glMultiTexCoord4fvARB",
+ "glMultiTexCoord4ivARB",
+ "glMultiTexCoord4svARB",
+ "glNewList",
+ "glNormal3bv",
+ "glNormal3dv",
+ "glNormal3fv",
+ "glNormal3iv",
+ "glNormal3sv",
+ "glNormalPointer",
+ "glOrtho",
+ "glPassThrough",
+ "glPixelMapfv",
+ "glPixelMapuiv",
+ "glPixelMapusv",
+ "glPixelStoref",
+ "glPixelStorei",
+ "glPixelTransferf",
+ "glPixelTransferi",
+ "glPixelZoom",
+ "glPointParameterfARB",
+ "glPointParameterfvARB",
+ "glPointSize",
+ "glPolygonMode",
+ "glPolygonOffset",
+ "glPolygonStipple",
+ "glPopAttrib",
+ "glPopMatrix",
+ "glPopName",
+ "glPrioritizeTextures",
+ "glPushAttrib",
+ "glPushMatrix",
+ "glPushName",
+ "glRasterPos2dv",
+ "glRasterPos2fv",
+ "glRasterPos2iv",
+ "glRasterPos2sv",
+ "glRasterPos3dv",
+ "glRasterPos3fv",
+ "glRasterPos3iv",
+ "glRasterPos3sv",
+ "glRasterPos4dv",
+ "glRasterPos4fv",
+ "glRasterPos4iv",
+ "glRasterPos4sv",
+ "glReadBuffer",
+ "glReadPixels",
+ "glRectdv",
+ "glRectfv",
+ "glRectiv",
+ "glRectsv",
+ "glRenderMode",
+ "glResetHistogram",
+ "glResetMinmax",
+ "glRotated",
+ "glRotatef",
+ "glScaled",
+ "glScalef",
+ "glScissor",
+ "glSelectBuffer",
+ "glSeparableFilter2D",
+ "glShadeModel",
+ "glStencilFunc",
+ "glStencilMask",
+ "glStencilOp",
+ "glTexCoord1dv",
+ "glTexCoord1fv",
+ "glTexCoord1iv",
+ "glTexCoord1sv",
+ "glTexCoord2dv",
+ "glTexCoord2fv",
+ "glTexCoord2iv",
+ "glTexCoord2sv",
+ "glTexCoord3dv",
+ "glTexCoord3fv",
+ "glTexCoord3iv",
+ "glTexCoord3sv",
+ "glTexCoord4dv",
+ "glTexCoord4fv",
+ "glTexCoord4iv",
+ "glTexCoord4sv",
+ "glTexCoordPointer",
+ "glTexEnvf",
+ "glTexEnvfv",
+ "glTexEnvi",
+ "glTexEnviv",
+ "glTexGend",
+ "glTexGendv",
+ "glTexGenf",
+ "glTexGenfv",
+ "glTexGeni",
+ "glTexGeniv",
+ "glTexImage1D",
+ "glTexImage2D",
+ "glTexImage3D",
+ "glTexParameterf",
+ "glTexParameterfv",
+ "glTexParameteri",
+ "glTexParameteriv",
+ "glTexSubImage1D",
+ "glTexSubImage2D",
+ "glTexSubImage3D",
+ "glTranslated",
+ "glTranslatef",
+ "glVertex2dv",
+ "glVertex2fv",
+ "glVertex2iv",
+ "glVertex2sv",
+ "glVertex3dv",
+ "glVertex3fv",
+ "glVertex3iv",
+ "glVertex3sv",
+ "glVertex4dv",
+ "glVertex4fv",
+ "glVertex4iv",
+ "glVertex4sv",
+ "glVertexPointer",
+ "glViewport",
+ "glWindowPos3fARB",
+ "glxSwapQueryExtensionsStringReply",
+ "glxSwapQueryServerStringReply",
+ NULL
+};
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "glx",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL };
+
+static pointer
+glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+ pointer GLcore = NULL;
+#ifdef GLX_USE_SGI_SI
+ char GLcoreName[] = "GL";
+#else
+ char GLcoreName[] = "GLcore";
+#endif
+
+ if (!setupDone) {
+ setupDone = TRUE;
+
+ GLcore = LoadSubModule(module, GLcoreName, NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+ if (!GLcore) {
+ if (errmaj) *errmaj = LDR_NOSUBENT;
+ } else {
+ LoaderReqSymLists(glcoreSymbols, NULL);
+ LoadExtension(&GLXExt, FALSE);
+ /* Wrap the init visuals routine in micmap.c */
+ GlxWrapInitVisuals(&miInitVisualsProc);
+ /* Make sure this gets wrapped each time InitVisualWrap is called */
+ miHookInitVisuals(NULL, GlxWrapInitVisuals);
+ }
+ } else {
+ if (errmaj) *errmaj = LDR_ONCEONLY;
+ }
+ /* Need a non-NULL return value to indicate success */
+ return GLcore;
+}
diff --git a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h
new file mode 100644
index 000000000..c94393fd1
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h
@@ -0,0 +1,115 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _glx_ansic_h_
+#define _glx_ansic_h_
+
+/* $XFree86: xc/programs/Xserver/GL/include/GL/glx_ansic.h,v 1.5 2001/03/21 20:49:08 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/*
+** this needs to check whether we're using XFree86 at all, and then
+** which version we're using. Use these macros if version is 3.9+, else
+** use normal commands below.
+*/
+
+/*
+** turns out this include file only exists for XFree86 3.9+
+** I notice that not having it is not an error and does not stop the build,
+** but having it will allow opengl and glx to be built for 3.9+. We no longer
+** need an explicit define in the Makefile, just point to the correct X source
+** tree and all should be taken care of.
+*/
+
+#ifdef XFree86Server
+
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+#endif
+#ifndef assert
+#define assert(a)
+#endif
+
+#else
+
+#if defined(Lynx) && defined(__assert_h)
+#undef __assert_h
+#endif
+#ifdef assert
+#undef assert
+#endif
+#include <assert.h>
+
+#endif
+
+
+#define GLX_STDOUT stdout
+#define GLX_STDERR stderr
+#define __glXPrintf printf
+#define __glXFprintf fprintf
+#define __glXSprintf sprintf
+#define __glXVfprintf vfprintf
+#define __glXVsprintf vsprintf
+#define __glXFopen fopen
+#define __glXFclose fclose
+#define __glXCos(x) cos(x)
+#define __glXSin(x) sin(x)
+#define __glXAtan(x) atan(x)
+#define __glXAbs(x) abs(x)
+#define __glXLog(x) log(x)
+#define __glXCeil(x) ceil(x)
+#define __glXFloor(x) floor(x)
+#define __glXSqrt(x) sqrt(x)
+#define __glXPow(x, y) pow(x, y)
+#define __glXMemmove(dest, src, n) memmove(dest, src, n)
+#define __glXMemcpy(dest, src, n) memcpy(dest, src, n)
+#define __glXMemset(s, c, n) memset(s, c, n)
+#define __glXStrdup(str) xstrdup(str)
+#define __glXStrcpy(dest, src) strcpy(dest, src)
+#define __glXStrncpy(dest, src, n) strncpy(dest, src, n)
+#define __glXStrcat(dest, src) strcat(dest, src)
+#define __glXStrncat(dest, src, n) strncat(dest, src, n)
+#define __glXStrcmp(s1, s2) strcmp(s1, s2)
+#define __glXStrncmp(s1, s2, n) strncmp(s1, s2, n)
+#define __glXStrlen(str) strlen(str)
+#define __glXAbort() abort()
+#define __glXStrtok(s, delim) strtok(s, delim)
+#define __glXStrcspn(s, reject) strcspn(s, reject)
+#define __glXGetenv(a) getenv(a)
+#define __glXAtoi(a) atoi(a)
+
+#endif /* _glx_ansic_h_ */
+
diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h
new file mode 100644
index 000000000..66f096a98
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h
@@ -0,0 +1,43 @@
+/* $XFree86: xc/programs/Xserver/GL/include/GL/xf86glx.h,v 1.3 1999/06/14 07:31:41 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "miscstruct.h"
+
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+#endif
diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp
new file mode 100644
index 000000000..6fca465cd
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp
@@ -0,0 +1,1462 @@
+LIBRARY GLcore
+VERSION LIBRARY_VERSION
+EXPORTS
+
+_mesa_set_aa_triangle_function
+_mesa_Accum
+_mesa_ClearAccum
+_mesa_alloc_accum_buffer
+_mesa_clear_accum_buffer
+_mesa_AlphaFunc
+_mesa_alpha_test
+_mesa_alloc_alpha_buffers
+_mesa_clear_alpha_buffers
+_mesa_read_alpha_pixels
+_mesa_read_alpha_span
+_mesa_write_alpha_pixels
+_mesa_write_alpha_span
+_mesa_write_mono_alpha_pixels
+_mesa_write_mono_alpha_span
+_mesa_PopAttrib
+_mesa_PopClientAttrib
+_mesa_PushAttrib
+_mesa_PushClientAttrib
+_mesa_Bitmap
+_mesa_BlendColor
+_mesa_BlendEquation
+_mesa_BlendFunc
+_mesa_BlendFuncSeparateEXT
+_mesa_blend_pixels
+_mesa_blend_span
+_mesa_Clear
+_mesa_ClearColor
+_mesa_ClearIndex
+_mesa_DrawBuffer
+_mesa_ReadBuffer
+_mesa_ResizeBuffersMESA
+_mesa_ClipPlane
+_mesa_GetClipPlane
+gl_init_clip
+gl_update_clipmask
+gl_update_userclip
+gl_user_cliptest
+gl_userclip_point
+gl_viewclip_point
+_mesa_ColorSubTable
+_mesa_ColorTable
+_mesa_ColorTableParameterfv
+_mesa_ColorTableParameteriv
+_mesa_CopyColorSubTable
+_mesa_CopyColorTable
+_mesa_GetColorTable
+_mesa_GetColorTableParameterfv
+_mesa_GetColorTableParameteriv
+_mesa_free_colortable_data
+_mesa_init_colortable
+gl_read_config_file
+gl_register_config_var
+_mesa_Finish
+_mesa_Flush
+_mesa_create_visual
+_mesa_destroy_visual
+_mesa_get_dispatch
+_mesa_initialize_context
+_mesa_initialize_framebuffer
+_mesa_initialize_visual
+_mesa_swapbuffers
+gl_compile_error
+gl_context_initialize
+gl_copy_context
+gl_create_context
+gl_create_framebuffer
+gl_create_visual
+gl_destroy_context
+gl_destroy_framebuffer
+gl_destroy_visual
+gl_error
+gl_free_context_data
+gl_get_current_context
+gl_make_current
+gl_make_current2
+gl_problem
+gl_warning
+_mesa_CopyPixels
+_mesa_LockArraysEXT
+_mesa_UnlockArraysEXT
+gl_alloc_cva_store
+gl_cva_compile_cassette
+gl_cva_force_precalc
+gl_cva_init
+gl_free_cva_store
+gl_merge_cva
+gl_prepare_arrays_cva
+gl_rescue_cva
+_mesa_ClearDepth
+_mesa_DepthFunc
+_mesa_DepthMask
+_mesa_alloc_depth_buffer
+_mesa_clear_depth_buffer
+_mesa_depth_test_pixels
+_mesa_depth_test_span
+_mesa_read_depth_span
+_mesa_read_depth_span_float
+_mesa_zbuffer_address
+glAccum
+glActiveTextureARB
+glAlphaFunc
+glAreTexturesResident
+glAreTexturesResidentEXT
+glArrayElement
+glArrayElementEXT
+glBegin
+glBindTexture
+glBindTextureEXT
+glBitmap
+glBlendColor
+glBlendColorEXT
+glBlendEquation
+glBlendEquationEXT
+glBlendFunc
+glBlendFuncSeparateEXT
+glBlendFuncSeparateINGR
+glCallList
+glCallLists
+glClear
+glClearAccum
+glClearColor
+glClearDepth
+glClearIndex
+glClearStencil
+glClientActiveTextureARB
+glClipPlane
+glColor3b
+glColor3bv
+glColor3d
+glColor3dv
+glColor3f
+glColor3fv
+glColor3i
+glColor3iv
+glColor3s
+glColor3sv
+glColor3ub
+glColor3ubv
+glColor3ui
+glColor3uiv
+glColor3us
+glColor3usv
+glColor4b
+glColor4bv
+glColor4d
+glColor4dv
+glColor4f
+glColor4fv
+glColor4i
+glColor4iv
+glColor4s
+glColor4sv
+glColor4ub
+glColor4ubv
+glColor4ui
+glColor4uiv
+glColor4us
+glColor4usv
+glColorMask
+glColorMaterial
+glColorPointer
+glColorPointerEXT
+glColorSubTable
+glColorSubTableEXT
+glColorTable
+glColorTableEXT
+glColorTableParameterfv
+glColorTableParameterfvSGI
+glColorTableParameteriv
+glColorTableParameterivSGI
+glColorTableSGI
+glCombinerInputNV
+glCombinerOutputNV
+glCombinerParameterfNV
+glCombinerParameterfvNV
+glCombinerParameteriNV
+glCombinerParameterivNV
+glCompressedTexImage1DARB
+glCompressedTexImage2DARB
+glCompressedTexImage3DARB
+glCompressedTexSubImage1DARB
+glCompressedTexSubImage2DARB
+glCompressedTexSubImage3DARB
+glConvolutionFilter1D
+glConvolutionFilter1DEXT
+glConvolutionFilter2D
+glConvolutionFilter2DEXT
+glConvolutionParameterf
+glConvolutionParameterfEXT
+glConvolutionParameterfv
+glConvolutionParameterfvEXT
+glConvolutionParameteri
+glConvolutionParameteriEXT
+glConvolutionParameteriv
+glConvolutionParameterivEXT
+glCopyColorSubTable
+glCopyColorSubTableEXT
+glCopyColorTable
+glCopyColorTableSGI
+glCopyConvolutionFilter1D
+glCopyConvolutionFilter1DEXT
+glCopyConvolutionFilter2D
+glCopyConvolutionFilter2DEXT
+glCopyPixels
+glCopyTexImage1D
+glCopyTexImage1DEXT
+glCopyTexImage2D
+glCopyTexImage2DEXT
+glCopyTexSubImage1D
+glCopyTexSubImage1DEXT
+glCopyTexSubImage2D
+glCopyTexSubImage2DEXT
+glCopyTexSubImage3D
+glCopyTexSubImage3DEXT
+glCullFace
+glCullParameterdvEXT
+glCullParameterfvEXT
+glDeleteLists
+glDeleteTextures
+glDeleteTexturesEXT
+glDepthFunc
+glDepthMask
+glDepthRange
+glDetailTexFuncSGIS
+glDisable
+glDisableClientState
+glDrawArrays
+glDrawArraysEXT
+glDrawBuffer
+glDrawElements
+glDrawPixels
+glDrawRangeElements
+glDrawRangeElementsEXT
+glEdgeFlag
+glEdgeFlagPointer
+glEdgeFlagPointerEXT
+glEdgeFlagv
+glEnable
+glEnableClientState
+glEnd
+glEndList
+glEvalCoord1d
+glEvalCoord1dv
+glEvalCoord1f
+glEvalCoord1fv
+glEvalCoord2d
+glEvalCoord2dv
+glEvalCoord2f
+glEvalCoord2fv
+glEvalMesh1
+glEvalMesh2
+glEvalPoint1
+glEvalPoint2
+glFeedbackBuffer
+glFinalCombinerInputNV
+glFinish
+glFlush
+glFlushRasterSGIX
+glFlushVertexArrayRangeNV
+glFogCoordPointerEXT
+glFogCoorddEXT
+glFogCoorddvEXT
+glFogCoordfEXT
+glFogCoordfvEXT
+glFogf
+glFogfv
+glFogi
+glFogiv
+glFragmentColorMaterialSGIX
+glFragmentLightModelfSGIX
+glFragmentLightModelfvSGIX
+glFragmentLightModeliSGIX
+glFragmentLightModelivSGIX
+glFragmentLightfSGIX
+glFragmentLightfvSGIX
+glFragmentLightiSGIX
+glFragmentLightivSGIX
+glFragmentMaterialfSGIX
+glFragmentMaterialfvSGIX
+glFragmentMaterialiSGIX
+glFragmentMaterialivSGIX
+glFrameZoomSGIX
+glFrontFace
+glFrustum
+glGenLists
+glGenTextures
+glGenTexturesEXT
+glGetBooleanv
+glGetClipPlane
+glGetColorTable
+glGetColorTableEXT
+glGetColorTableParameterfv
+glGetColorTableParameterfvEXT
+glGetColorTableParameterfvSGI
+glGetColorTableParameteriv
+glGetColorTableParameterivEXT
+glGetColorTableParameterivSGI
+glGetColorTableSGI
+glGetCombinerInputParameterfvNV
+glGetCombinerInputParameterivNV
+glGetCombinerOutputParameterfvNV
+glGetCombinerOutputParameterivNV
+glGetCompressedTexImageARB
+glGetConvolutionFilter
+glGetConvolutionFilterEXT
+glGetConvolutionParameterfv
+glGetConvolutionParameterfvEXT
+glGetConvolutionParameteriv
+glGetConvolutionParameterivEXT
+glGetDetailTexFuncSGIS
+glGetDoublev
+glGetError
+glGetFinalCombinerInputParameterfvNV
+glGetFinalCombinerInputParameterivNV
+glGetFloatv
+glGetFragmentLightfvSGIX
+glGetFragmentLightivSGIX
+glGetFragmentMaterialfvSGIX
+glGetFragmentMaterialivSGIX
+glGetHistogram
+glGetHistogramEXT
+glGetHistogramParameterfv
+glGetHistogramParameterfvEXT
+glGetHistogramParameteriv
+glGetHistogramParameterivEXT
+glGetInstrumentsSGIX
+glGetIntegerv
+glGetLightfv
+glGetLightiv
+glGetListParameterfvSGIX
+glGetListParameterivSGIX
+glGetMapdv
+glGetMapfv
+glGetMapiv
+glGetMaterialfv
+glGetMaterialiv
+glGetMinmax
+glGetMinmaxEXT
+glGetMinmaxParameterfv
+glGetMinmaxParameterfvEXT
+glGetMinmaxParameteriv
+glGetMinmaxParameterivEXT
+glGetPixelMapfv
+glGetPixelMapuiv
+glGetPixelMapusv
+glGetPixelTexGenParameterfvSGIS
+glGetPixelTexGenParameterivSGIS
+glGetPointerv
+glGetPointervEXT
+glGetPolygonStipple
+glGetSeparableFilter
+glGetSeparableFilterEXT
+glGetSharpenTexFuncSGIS
+glGetString
+glGetTexEnvfv
+glGetTexEnviv
+glGetTexFilterFuncSGIS
+glGetTexGendv
+glGetTexGenfv
+glGetTexGeniv
+glGetTexImage
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterfv
+glGetTexParameteriv
+glHint
+glHintPGI
+glHistogram
+glHistogramEXT
+glIndexFuncEXT
+glIndexMask
+glIndexMaterialEXT
+glIndexPointer
+glIndexPointerEXT
+glIndexd
+glIndexdv
+glIndexf
+glIndexfv
+glIndexi
+glIndexiv
+glIndexs
+glIndexsv
+glIndexub
+glIndexubv
+glInitNames
+glInstrumentsBufferSGIX
+glInterleavedArrays
+glIsEnabled
+glIsList
+glIsTexture
+glIsTextureEXT
+glLightEnviSGIX
+glLightModelf
+glLightModelfv
+glLightModeli
+glLightModeliv
+glLightf
+glLightfv
+glLighti
+glLightiv
+glLineStipple
+glLineWidth
+glListBase
+glListParameterfSGIX
+glListParameterfvSGIX
+glListParameteriSGIX
+glListParameterivSGIX
+glLoadIdentity
+glLoadMatrixd
+glLoadMatrixf
+glLoadName
+glLoadTransposeMatrixdARB
+glLoadTransposeMatrixfARB
+glLockArraysEXT
+glLogicOp
+glMap1d
+glMap1f
+glMap2d
+glMap2f
+glMapGrid1d
+glMapGrid1f
+glMapGrid2d
+glMapGrid2f
+glMaterialf
+glMaterialfv
+glMateriali
+glMaterialiv
+glMatrixMode
+glMinmax
+glMinmaxEXT
+glMultMatrixd
+glMultMatrixf
+glMultTransposeMatrixdARB
+glMultTransposeMatrixfARB
+glMultiTexCoord1dARB
+glMultiTexCoord1dvARB
+glMultiTexCoord1fARB
+glMultiTexCoord1fvARB
+glMultiTexCoord1iARB
+glMultiTexCoord1ivARB
+glMultiTexCoord1sARB
+glMultiTexCoord1svARB
+glMultiTexCoord2dARB
+glMultiTexCoord2dvARB
+glMultiTexCoord2fARB
+glMultiTexCoord2fvARB
+glMultiTexCoord2iARB
+glMultiTexCoord2ivARB
+glMultiTexCoord2sARB
+glMultiTexCoord2svARB
+glMultiTexCoord3dARB
+glMultiTexCoord3dvARB
+glMultiTexCoord3fARB
+glMultiTexCoord3fvARB
+glMultiTexCoord3iARB
+glMultiTexCoord3ivARB
+glMultiTexCoord3sARB
+glMultiTexCoord3svARB
+glMultiTexCoord4dARB
+glMultiTexCoord4dvARB
+glMultiTexCoord4fARB
+glMultiTexCoord4fvARB
+glMultiTexCoord4iARB
+glMultiTexCoord4ivARB
+glMultiTexCoord4sARB
+glMultiTexCoord4svARB
+glNewList
+glNormal3b
+glNormal3bv
+glNormal3d
+glNormal3dv
+glNormal3f
+glNormal3fv
+glNormal3i
+glNormal3iv
+glNormal3s
+glNormal3sv
+glNormalPointer
+glNormalPointerEXT
+glOrtho
+glPassThrough
+glPixelMapfv
+glPixelMapuiv
+glPixelMapusv
+glPixelStoref
+glPixelStorei
+glPixelTexGenParameterfSGIS
+glPixelTexGenParameterfvSGIS
+glPixelTexGenParameteriSGIS
+glPixelTexGenParameterivSGIS
+glPixelTexGenSGIX
+glPixelTransferf
+glPixelTransferi
+glPixelZoom
+glPointParameterfEXT
+glPointParameterfSGIS
+glPointParameterfvEXT
+glPointParameterfvSGIS
+glPointSize
+glPollInstrumentsSGIX
+glPolygonMode
+glPolygonOffset
+glPolygonOffsetEXT
+glPolygonStipple
+glPopAttrib
+glPopClientAttrib
+glPopMatrix
+glPopName
+glPrioritizeTextures
+glPrioritizeTexturesEXT
+glPushAttrib
+glPushClientAttrib
+glPushMatrix
+glPushName
+glRasterPos2d
+glRasterPos2dv
+glRasterPos2f
+glRasterPos2fv
+glRasterPos2i
+glRasterPos2iv
+glRasterPos2s
+glRasterPos2sv
+glRasterPos3d
+glRasterPos3dv
+glRasterPos3f
+glRasterPos3fv
+glRasterPos3i
+glRasterPos3iv
+glRasterPos3s
+glRasterPos3sv
+glRasterPos4d
+glRasterPos4dv
+glRasterPos4f
+glRasterPos4fv
+glRasterPos4i
+glRasterPos4iv
+glRasterPos4s
+glRasterPos4sv
+glReadBuffer
+glReadInstrumentsSGIX
+glReadPixels
+glRectd
+glRectdv
+glRectf
+glRectfv
+glRecti
+glRectiv
+glRects
+glRectsv
+glReferencePlaneSGIX
+glRenderMode
+glResetHistogram
+glResetHistogramEXT
+glResetMinmax
+glResetMinmaxEXT
+glResizeBuffersMESA
+glRotated
+glRotatef
+glSampleCoverageARB
+glSampleMaskEXT
+glSampleMaskSGIS
+glSamplePassARB
+glSamplePatternEXT
+glSamplePatternSGIS
+glScaled
+glScalef
+glScissor
+glSelectBuffer
+glSeparableFilter2D
+glSeparableFilter2DEXT
+glShadeModel
+glSharpenTexFuncSGIS
+glSpriteParameterfSGIX
+glSpriteParameterfvSGIX
+glSpriteParameteriSGIX
+glSpriteParameterivSGIX
+glStartInstrumentsSGIX
+glStencilFunc
+glStencilMask
+glStencilOp
+glStopInstrumentsSGIX
+glTagSampleBufferSGIX
+glTbufferMask3DFX
+glTexCoord1d
+glTexCoord1dv
+glTexCoord1f
+glTexCoord1fv
+glTexCoord1i
+glTexCoord1iv
+glTexCoord1s
+glTexCoord1sv
+glTexCoord2d
+glTexCoord2dv
+glTexCoord2f
+glTexCoord2fv
+glTexCoord2i
+glTexCoord2iv
+glTexCoord2s
+glTexCoord2sv
+glTexCoord3d
+glTexCoord3dv
+glTexCoord3f
+glTexCoord3fv
+glTexCoord3i
+glTexCoord3iv
+glTexCoord3s
+glTexCoord3sv
+glTexCoord4d
+glTexCoord4dv
+glTexCoord4f
+glTexCoord4fv
+glTexCoord4i
+glTexCoord4iv
+glTexCoord4s
+glTexCoord4sv
+glTexCoordPointer
+glTexCoordPointerEXT
+glTexEnvf
+glTexEnvfv
+glTexEnvi
+glTexEnviv
+glTexFilterFuncSGIS
+glTexGend
+glTexGendv
+glTexGenf
+glTexGenfv
+glTexGeni
+glTexGeniv
+glTexImage1D
+glTexImage2D
+glTexImage3D
+glTexImage3DEXT
+glTexImage4DSGIS
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexSubImage1D
+glTexSubImage1DEXT
+glTexSubImage2D
+glTexSubImage2DEXT
+glTexSubImage3D
+glTexSubImage3DEXT
+glTexSubImage4DSGIS
+glTranslated
+glTranslatef
+glUnlockArraysEXT
+glVertex2d
+glVertex2dv
+glVertex2f
+glVertex2fv
+glVertex2i
+glVertex2iv
+glVertex2s
+glVertex2sv
+glVertex3d
+glVertex3dv
+glVertex3f
+glVertex3fv
+glVertex3i
+glVertex3iv
+glVertex3s
+glVertex3sv
+glVertex4d
+glVertex4dv
+glVertex4f
+glVertex4fv
+glVertex4i
+glVertex4iv
+glVertex4s
+glVertex4sv
+glVertexArrayRangeNV
+glVertexPointer
+glVertexPointerEXT
+glVertexWeightPointerEXT
+glVertexWeightfEXT
+glVertexWeightfvEXT
+glViewport
+glWindowPos2dMESA
+glWindowPos2dvMESA
+glWindowPos2fMESA
+glWindowPos2fvMESA
+glWindowPos2iMESA
+glWindowPos2ivMESA
+glWindowPos2sMESA
+glWindowPos2svMESA
+glWindowPos3dMESA
+glWindowPos3dvMESA
+glWindowPos3fMESA
+glWindowPos3fvMESA
+glWindowPos3iMESA
+glWindowPos3ivMESA
+glWindowPos3sMESA
+glWindowPos3svMESA
+glWindowPos4dMESA
+glWindowPos4dvMESA
+glWindowPos4fMESA
+glWindowPos4fvMESA
+glWindowPos4iMESA
+glWindowPos4ivMESA
+glWindowPos4sMESA
+glWindowPos4svMESA
+_mesa_CallList
+_mesa_CallLists
+_mesa_DeleteLists
+_mesa_EndList
+_mesa_GenLists
+_mesa_IsList
+_mesa_ListBase
+_mesa_NewList
+_mesa_init_dlist_table
+gl_compile_cassette
+gl_destroy_list
+gl_init_lists
+gl_save_error
+mesa_print_display_list
+_mesa_DrawPixels
+_mesa_clip_pixelrect
+_mesa_Disable
+_mesa_DisableClientState
+_mesa_Enable
+_mesa_EnableClientState
+_mesa_IsEnabled
+_mesa_set_enable
+gl_lookup_enum_by_name
+gl_lookup_enum_by_nr
+_mesa_EvalCoord1d
+_mesa_EvalCoord1dv
+_mesa_EvalCoord1f
+_mesa_EvalCoord1fv
+_mesa_EvalCoord2d
+_mesa_EvalCoord2dv
+_mesa_EvalCoord2f
+_mesa_EvalCoord2fv
+_mesa_EvalMesh1
+_mesa_EvalMesh2
+_mesa_EvalPoint1
+_mesa_EvalPoint2
+_mesa_GetMapdv
+_mesa_GetMapfv
+_mesa_GetMapiv
+_mesa_Map1d
+_mesa_Map1f
+_mesa_Map2d
+_mesa_Map2f
+_mesa_MapGrid1d
+_mesa_MapGrid1f
+_mesa_MapGrid2d
+_mesa_MapGrid2f
+_mesa_evaluator_components
+gl_copy_map_points1d
+gl_copy_map_points1f
+gl_copy_map_points2d
+gl_copy_map_points2f
+gl_eval_vb
+gl_init_eval
+gl_extension_is_enabled
+gl_extensions_add
+gl_extensions_ctr
+gl_extensions_disable
+gl_extensions_dtr
+gl_extensions_enable
+gl_extensions_get_string
+_mesa_FeedbackBuffer
+_mesa_InitNames
+_mesa_LoadName
+_mesa_PassThrough
+_mesa_PopName
+_mesa_PushName
+_mesa_RenderMode
+_mesa_SelectBuffer
+gl_feedback_line
+gl_feedback_points
+gl_feedback_triangle
+gl_feedback_vertex
+gl_select_line
+gl_select_points
+gl_select_triangle
+gl_update_hitflag
+_mesa_Fogf
+_mesa_Fogfv
+_mesa_Fogi
+_mesa_Fogiv
+_mesa_fog_ci_pixels
+_mesa_fog_rgba_pixels
+_mesa_fog_vertices
+_mesa_init_fog
+_mesa_GetBooleanv
+_mesa_GetDoublev
+_mesa_GetError
+_mesa_GetFloatv
+_mesa_GetIntegerv
+_mesa_GetPointerv
+_mesa_GetString
+_glapi_add_entrypoint
+_glapi_check_multithread
+_glapi_check_table
+_glapi_get_context
+_glapi_get_dispatch
+_glapi_get_dispatch_table_size
+_glapi_get_proc_address
+_glapi_get_proc_name
+_glapi_get_proc_offset
+_glapi_get_version
+_glapi_set_context
+_glapi_set_dispatch
+_glapi_noop_enable_warnings
+_glthread_GetID
+_glthread_GetTSD
+_glthread_InitTSD
+_glthread_SetTSD
+_mesa_DeleteHashTable
+_mesa_HashFindFreeKeyBlock
+_mesa_HashFirstEntry
+_mesa_HashInsert
+_mesa_HashLookup
+_mesa_HashPrint
+_mesa_HashRemove
+_mesa_NewHashTable
+_mesa_Hint
+_mesa_HintPGI
+_mesa_try_Hint
+_mesa_bytes_per_pixel
+_mesa_components_in_format
+_mesa_image_address
+_mesa_image_row_stride
+_mesa_is_legal_format_and_type
+_mesa_native_packing
+_mesa_pack_bitmap
+_mesa_pack_polygon_stipple
+_mesa_pack_rgba_span
+_mesa_sizeof_packed_type
+_mesa_sizeof_type
+_mesa_swap2
+_mesa_swap4
+_mesa_unpack_bitmap
+_mesa_unpack_depth_span
+_mesa_unpack_float_color_span
+_mesa_unpack_image
+_mesa_unpack_index_span
+_mesa_unpack_polygon_stipple
+_mesa_unpack_stencil_span
+_mesa_unpack_ubyte_color_span
+_mesa_ConvolutionFilter1D
+_mesa_ConvolutionFilter2D
+_mesa_ConvolutionParameterf
+_mesa_ConvolutionParameterfv
+_mesa_ConvolutionParameteri
+_mesa_ConvolutionParameteriv
+_mesa_CopyConvolutionFilter1D
+_mesa_CopyConvolutionFilter2D
+_mesa_GetConvolutionFilter
+_mesa_GetConvolutionParameterfv
+_mesa_GetConvolutionParameteriv
+_mesa_GetHistogram
+_mesa_GetHistogramParameterfv
+_mesa_GetHistogramParameteriv
+_mesa_GetMinmax
+_mesa_GetMinmaxParameterfv
+_mesa_GetMinmaxParameteriv
+_mesa_GetSeparableFilter
+_mesa_Histogram
+_mesa_Minmax
+_mesa_ResetHistogram
+_mesa_ResetMinmax
+_mesa_SeparableFilter2D
+_mesa_update_histogram
+_mesa_update_minmax
+_mesa_ColorMaterial
+_mesa_GetLightfv
+_mesa_GetLightiv
+_mesa_GetMaterialfv
+_mesa_GetMaterialiv
+_mesa_LightModelf
+_mesa_LightModelfv
+_mesa_LightModeli
+_mesa_LightModeliv
+_mesa_Lightf
+_mesa_Lightfv
+_mesa_Lighti
+_mesa_Lightiv
+_mesa_Materialf
+_mesa_Materialfv
+_mesa_Materiali
+_mesa_Materialiv
+_mesa_ShadeModel
+gl_compute_light_positions
+gl_compute_shine_table
+gl_compute_spot_exp_table
+gl_material_bitmask
+gl_update_color_material
+gl_update_lighting
+gl_update_material
+gl_update_normal_transform
+_mesa_LineStipple
+_mesa_LineWidth
+gl_set_line_function
+_mesa_LogicOp
+_mesa_logicop_ci_pixels
+_mesa_logicop_ci_span
+_mesa_logicop_rgba_pixels
+_mesa_logicop_rgba_span
+_mesa_ColorMask
+_mesa_IndexMask
+_mesa_mask_index_pixels
+_mesa_mask_index_span
+_mesa_mask_rgba_pixels
+_mesa_mask_rgba_span
+_mesa_DepthRange
+_mesa_Frustum
+_mesa_LoadIdentity
+_mesa_LoadMatrixd
+_mesa_LoadMatrixf
+_mesa_LoadTransposeMatrixdARB
+_mesa_LoadTransposeMatrixfARB
+_mesa_MatrixMode
+_mesa_MultMatrixd
+_mesa_MultMatrixf
+_mesa_MultTransposeMatrixdARB
+_mesa_MultTransposeMatrixfARB
+_mesa_Ortho
+_mesa_PopMatrix
+_mesa_PushMatrix
+_mesa_Rotated
+_mesa_Rotatef
+_mesa_Scaled
+_mesa_Scalef
+_mesa_Translated
+_mesa_Translatef
+_mesa_Viewport
+gl_Viewport
+gl_calculate_model_project_matrix
+gl_mat_mul_floats
+gl_mat_mul_mat
+gl_matrix_alloc_inv
+gl_matrix_analyze
+gl_matrix_copy
+gl_matrix_ctr
+gl_matrix_dtr
+gl_matrix_invert
+gl_matrix_mul
+gl_matrix_transposed
+gl_matrix_transposef
+gl_print_matrix
+gl_rotation_matrix
+_mesa_calloc
+_mesa_free
+_mesa_malloc
+_mesa_bitcount
+_mesa_init_math
+gl_sqrt
+gl_alloc_pb
+gl_flush_pb
+gl_build_immediate_pipeline
+gl_build_precalc_pipeline
+gl_pipeline_init
+gl_print_active_pipeline
+gl_print_pipe_ops
+gl_print_pipeline
+gl_print_tri_caps
+gl_print_vert_flags
+gl_reset_cva_vb
+gl_run_pipeline
+gl_update_pipelines
+_mesa_GetPixelMapfv
+_mesa_GetPixelMapuiv
+_mesa_GetPixelMapusv
+_mesa_PixelMapfv
+_mesa_PixelMapuiv
+_mesa_PixelMapusv
+_mesa_PixelStoref
+_mesa_PixelStorei
+_mesa_PixelTransferf
+_mesa_PixelTransferi
+_mesa_PixelZoom
+_mesa_lookup_rgba
+_mesa_map_ci
+_mesa_map_ci8_to_rgba
+_mesa_map_ci_to_rgba
+_mesa_map_ci_to_rgba_ubyte
+_mesa_map_rgba
+_mesa_map_stencil
+_mesa_scale_and_bias_rgba
+_mesa_shift_and_offset_ci
+_mesa_shift_and_offset_stencil
+_mesa_transform_rgba
+_mesa_GetPixelTexGenParameterfvSGIS
+_mesa_GetPixelTexGenParameterivSGIS
+_mesa_PixelTexGenParameterfSGIS
+_mesa_PixelTexGenParameterfvSGIS
+_mesa_PixelTexGenParameteriSGIS
+_mesa_PixelTexGenParameterivSGIS
+_mesa_PixelTexGenSGIX
+_mesa_pixeltexgen
+_mesa_PointParameterfEXT
+_mesa_PointParameterfvEXT
+_mesa_PointSize
+gl_set_point_function
+_mesa_CullFace
+_mesa_FrontFace
+_mesa_GetPolygonStipple
+_mesa_PolygonMode
+_mesa_PolygonOffset
+_mesa_PolygonOffsetEXT
+_mesa_PolygonStipple
+gl_set_quad_function
+_mesa_RasterPos2d
+_mesa_RasterPos2dv
+_mesa_RasterPos2f
+_mesa_RasterPos2fv
+_mesa_RasterPos2i
+_mesa_RasterPos2iv
+_mesa_RasterPos2s
+_mesa_RasterPos2sv
+_mesa_RasterPos3d
+_mesa_RasterPos3dv
+_mesa_RasterPos3f
+_mesa_RasterPos3fv
+_mesa_RasterPos3i
+_mesa_RasterPos3iv
+_mesa_RasterPos3s
+_mesa_RasterPos3sv
+_mesa_RasterPos4d
+_mesa_RasterPos4dv
+_mesa_RasterPos4f
+_mesa_RasterPos4fv
+_mesa_RasterPos4i
+_mesa_RasterPos4iv
+_mesa_RasterPos4s
+_mesa_RasterPos4sv
+_mesa_ReadPixels
+_mesa_Rectd
+_mesa_Rectdv
+_mesa_Rectf
+_mesa_Rectfv
+_mesa_Recti
+_mesa_Rectiv
+_mesa_Rects
+_mesa_Rectsv
+_mesa_Scissor
+gl_scissor_pixels
+gl_scissor_span
+gl_init_shade
+gl_shade_rastpos
+gl_update_lighting_function
+gl_read_index_span
+gl_read_rgba_span
+gl_write_index_span
+gl_write_monocolor_span
+gl_write_monoindex_span
+gl_write_multitexture_span
+gl_write_rgba_span
+gl_write_texture_span
+gl_clean_color
+gl_default_nr_stages
+gl_default_pipeline
+gl_import_client_data
+gl_init_vbxform
+gl_update_materials
+_mesa_init_exec_table
+_mesa_init_no_op_table
+gl_print_enable_flags
+gl_print_state
+gl_update_state
+_mesa_ClearStencil
+_mesa_StencilFunc
+_mesa_StencilMask
+_mesa_StencilOp
+_mesa_alloc_stencil_buffer
+_mesa_clear_stencil_buffer
+_mesa_read_stencil_span
+_mesa_stencil_and_ztest_pixels
+_mesa_stencil_and_ztest_span
+_mesa_write_stencil_span
+_mesa_CompressedTexImage1DARB
+_mesa_CompressedTexImage2DARB
+_mesa_CompressedTexImage3DARB
+_mesa_CompressedTexSubImage1DARB
+_mesa_CompressedTexSubImage2DARB
+_mesa_CompressedTexSubImage3DARB
+_mesa_CopyTexImage1D
+_mesa_CopyTexImage2D
+_mesa_CopyTexSubImage1D
+_mesa_CopyTexSubImage2D
+_mesa_CopyTexSubImage3D
+_mesa_GetCompressedTexImageARB
+_mesa_GetTexImage
+_mesa_TexImage1D
+_mesa_TexImage2D
+_mesa_TexImage3D
+_mesa_TexImage3DEXT
+_mesa_TexSubImage1D
+_mesa_TexSubImage2D
+_mesa_TexSubImage3D
+_mesa_alloc_texture_image
+_mesa_base_tex_format
+_mesa_compressed_image_size
+_mesa_free_texture_image
+_mesa_get_teximage_from_driver
+_mesa_select_tex_image
+_mesa_select_tex_object
+_mesa_AreTexturesResident
+_mesa_BindTexture
+_mesa_DeleteTextures
+_mesa_GenTextures
+_mesa_IsTexture
+_mesa_PrioritizeTextures
+_mesa_test_texobj_completeness
+gl_alloc_texture_object
+gl_free_texture_object
+_mesa_ActiveTextureARB
+_mesa_ClientActiveTextureARB
+_mesa_GetTexEnvfv
+_mesa_GetTexEnviv
+_mesa_GetTexGendv
+_mesa_GetTexGenfv
+_mesa_GetTexGeniv
+_mesa_GetTexLevelParameterfv
+_mesa_GetTexLevelParameteriv
+_mesa_GetTexParameterfv
+_mesa_GetTexParameteriv
+_mesa_TexEnvf
+_mesa_TexEnvfv
+_mesa_TexEnvi
+_mesa_TexEnviv
+_mesa_TexGend
+_mesa_TexGendv
+_mesa_TexGenf
+_mesa_TexGenfv
+_mesa_TexGeni
+_mesa_TexGeniv
+_mesa_TexParameterf
+_mesa_TexParameterfv
+_mesa_TexParameteri
+_mesa_TexParameteriv
+gl_put_texobj_on_dirty_list
+gl_remove_texobj_from_dirty_list
+gl_update_dirty_texobjs
+_mesa_set_texture_sampler
+gl_init_texture
+gl_texture_pixels
+gl_update_texture_unit
+gl_init_translate
+gl_cull_triangle
+gl_set_triangle_function
+_mesa_ArrayElement
+_mesa_ColorPointer
+_mesa_ColorPointerEXT
+_mesa_DrawArrays
+_mesa_DrawElements
+_mesa_DrawRangeElements
+_mesa_EdgeFlagPointer
+_mesa_EdgeFlagPointerEXT
+_mesa_IndexPointer
+_mesa_IndexPointerEXT
+_mesa_InterleavedArrays
+_mesa_NormalPointer
+_mesa_NormalPointerEXT
+_mesa_TexCoordPointer
+_mesa_TexCoordPointerEXT
+_mesa_VertexPointer
+_mesa_VertexPointerEXT
+gl_exec_array_elements
+gl_update_client_state
+gl_immediate_alloc
+gl_immediate_free
+gl_vb_create_for_cva
+gl_vb_create_for_immediate
+gl_vb_free
+gl_cull_vb
+gl_dont_cull_vb
+gl_fast_copy_vb
+gl_make_normal_cullmask
+gl_purge_vertices
+_mesa_Begin
+_mesa_Color3b
+_mesa_Color3bv
+_mesa_Color3d
+_mesa_Color3dv
+_mesa_Color3f
+_mesa_Color3fv
+_mesa_Color3i
+_mesa_Color3iv
+_mesa_Color3s
+_mesa_Color3sv
+_mesa_Color3ub
+_mesa_Color3ubv
+_mesa_Color3ui
+_mesa_Color3uiv
+_mesa_Color3us
+_mesa_Color3usv
+_mesa_Color4b
+_mesa_Color4bv
+_mesa_Color4d
+_mesa_Color4dv
+_mesa_Color4f
+_mesa_Color4fv
+_mesa_Color4i
+_mesa_Color4iv
+_mesa_Color4s
+_mesa_Color4sv
+_mesa_Color4ub
+_mesa_Color4ubv
+_mesa_Color4ui
+_mesa_Color4uiv
+_mesa_Color4us
+_mesa_Color4usv
+_mesa_EdgeFlag
+_mesa_EdgeFlagv
+_mesa_End
+_mesa_Indexd
+_mesa_Indexdv
+_mesa_Indexf
+_mesa_Indexfv
+_mesa_Indexi
+_mesa_Indexiv
+_mesa_Indexs
+_mesa_Indexsv
+_mesa_Indexub
+_mesa_Indexubv
+_mesa_MultiTexCoord1dARB
+_mesa_MultiTexCoord1dvARB
+_mesa_MultiTexCoord1fARB
+_mesa_MultiTexCoord1fvARB
+_mesa_MultiTexCoord1iARB
+_mesa_MultiTexCoord1ivARB
+_mesa_MultiTexCoord1sARB
+_mesa_MultiTexCoord1svARB
+_mesa_MultiTexCoord2dARB
+_mesa_MultiTexCoord2dvARB
+_mesa_MultiTexCoord2fARB
+_mesa_MultiTexCoord2fvARB
+_mesa_MultiTexCoord2iARB
+_mesa_MultiTexCoord2ivARB
+_mesa_MultiTexCoord2sARB
+_mesa_MultiTexCoord2svARB
+_mesa_MultiTexCoord3dARB
+_mesa_MultiTexCoord3dvARB
+_mesa_MultiTexCoord3fARB
+_mesa_MultiTexCoord3fvARB
+_mesa_MultiTexCoord3iARB
+_mesa_MultiTexCoord3ivARB
+_mesa_MultiTexCoord3sARB
+_mesa_MultiTexCoord3svARB
+_mesa_MultiTexCoord4dARB
+_mesa_MultiTexCoord4dvARB
+_mesa_MultiTexCoord4fARB
+_mesa_MultiTexCoord4fvARB
+_mesa_MultiTexCoord4iARB
+_mesa_MultiTexCoord4ivARB
+_mesa_MultiTexCoord4sARB
+_mesa_MultiTexCoord4svARB
+_mesa_Normal3b
+_mesa_Normal3bv
+_mesa_Normal3d
+_mesa_Normal3dv
+_mesa_Normal3f
+_mesa_Normal3fv
+_mesa_Normal3i
+_mesa_Normal3iv
+_mesa_Normal3s
+_mesa_Normal3sv
+_mesa_TexCoord1d
+_mesa_TexCoord1dv
+_mesa_TexCoord1f
+_mesa_TexCoord1fv
+_mesa_TexCoord1i
+_mesa_TexCoord1iv
+_mesa_TexCoord1s
+_mesa_TexCoord1sv
+_mesa_TexCoord2d
+_mesa_TexCoord2dv
+_mesa_TexCoord2f
+_mesa_TexCoord2fv
+_mesa_TexCoord2i
+_mesa_TexCoord2iv
+_mesa_TexCoord2s
+_mesa_TexCoord2sv
+_mesa_TexCoord3d
+_mesa_TexCoord3dv
+_mesa_TexCoord3f
+_mesa_TexCoord3fv
+_mesa_TexCoord3i
+_mesa_TexCoord3iv
+_mesa_TexCoord3s
+_mesa_TexCoord3sv
+_mesa_TexCoord4d
+_mesa_TexCoord4dv
+_mesa_TexCoord4f
+_mesa_TexCoord4fv
+_mesa_TexCoord4i
+_mesa_TexCoord4iv
+_mesa_TexCoord4s
+_mesa_TexCoord4sv
+_mesa_Vertex2d
+_mesa_Vertex2dv
+_mesa_Vertex2f
+_mesa_Vertex2fv
+_mesa_Vertex2i
+_mesa_Vertex2iv
+_mesa_Vertex2s
+_mesa_Vertex2sv
+_mesa_Vertex3d
+_mesa_Vertex3dv
+_mesa_Vertex3f
+_mesa_Vertex3fv
+_mesa_Vertex3i
+_mesa_Vertex3iv
+_mesa_Vertex3s
+_mesa_Vertex3sv
+_mesa_Vertex4d
+_mesa_Vertex4dv
+_mesa_Vertex4f
+_mesa_Vertex4fv
+_mesa_Vertex4i
+_mesa_Vertex4iv
+_mesa_Vertex4s
+_mesa_Vertex4sv
+gl_Begin
+gl_End
+gl_Vertex2f
+gl_render_elts
+gl_render_vb_indirect
+gl_init_vbrender
+gl_reduced_prim_change
+gl_render_clipped_line
+gl_render_clipped_triangle
+gl_render_vb
+gl_set_render_vb_function
+RESET_IMMEDIATE
+gl_compute_orflag
+gl_copy_prev_vertices
+gl_copy_to_current
+gl_execute_cassette
+gl_fixup_cassette
+gl_fixup_input
+gl_flush_vb
+gl_internal_flush
+gl_maybe_transform_vb
+gl_print_cassette
+gl_print_cassette_flags
+gl_reset_input
+gl_reset_vb
+gl_texcoord_size
+gl_vector1ub_alloc
+gl_vector1ub_free
+gl_vector1ub_init
+gl_vector1ui_alloc
+gl_vector1ui_free
+gl_vector1ui_init
+gl_vector3f_alloc
+gl_vector3f_free
+gl_vector3f_init
+gl_vector3f_print
+gl_vector4f_alloc
+gl_vector4f_clean_elem
+gl_vector4f_free
+gl_vector4f_init
+gl_vector4f_print
+gl_vector4ub_alloc
+gl_vector4ub_free
+gl_vector4ub_init
+gl_init_vertices
+_mesa_WindowPos2dMESA
+_mesa_WindowPos2dvMESA
+_mesa_WindowPos2fMESA
+_mesa_WindowPos2fvMESA
+_mesa_WindowPos2iMESA
+_mesa_WindowPos2ivMESA
+_mesa_WindowPos2sMESA
+_mesa_WindowPos2svMESA
+_mesa_WindowPos3dMESA
+_mesa_WindowPos3dvMESA
+_mesa_WindowPos3fMESA
+_mesa_WindowPos3fvMESA
+_mesa_WindowPos3iMESA
+_mesa_WindowPos3ivMESA
+_mesa_WindowPos3sMESA
+_mesa_WindowPos3svMESA
+_mesa_WindowPos4dMESA
+_mesa_WindowPos4dvMESA
+_mesa_WindowPos4fMESA
+_mesa_WindowPos4fvMESA
+_mesa_WindowPos4iMESA
+_mesa_WindowPos4ivMESA
+_mesa_WindowPos4sMESA
+_mesa_WindowPos4svMESA
+gl_init_transformation
+gl_project_points
+gl_transform_point_sz
+gl_transform_vector
+gl_write_zoomed_index_span
+gl_write_zoomed_rgb_span
+gl_write_zoomed_rgba_span
+gl_write_zoomed_stencil_span
+__MESA_beginDispatchOverride
+__MESA_copyContext
+__MESA_createBuffer
+__MESA_createContext
+__MESA_destroyBuffer
+__MESA_destroyContext
+__MESA_dispatchExec
+__MESA_endDispatchOverride
+__MESA_forceCurrent
+__MESA_initVisuals
+__MESA_loseCurrent
+__MESA_makeCurrent
+__MESA_notifyDestroy
+__MESA_notifyResize
+__MESA_notifySwapBuffers
+__MESA_resetExtension
+__MESA_resizeBuffers
+__MESA_screenProbe
+__MESA_setVisualConfigs
+__MESA_shareContext
+__MESA_swapBuffers
+__glFloorLog2
+XMesaCreateImage
+XMesaDestroyImage
+XMesaGetPixel
+XMesaPutImageHelper
+XMesaCopySubBuffer
+XMesaCreateContext
+XMesaCreatePixmapBuffer
+XMesaCreateVisual
+XMesaCreateWindowBuffer
+XMesaCreateWindowBuffer2
+XMesaDestroyBuffer
+XMesaDestroyContext
+XMesaDestroyVisual
+XMesaDitherColor
+XMesaFindBuffer
+XMesaFlush
+XMesaForceCurrent
+XMesaGarbageCollect
+XMesaGetBackBuffer
+XMesaGetCurrentBuffer
+XMesaGetCurrentContext
+XMesaGetCurrentReadBuffer
+XMesaGetDepthBuffer
+XMesaGetString
+XMesaLoseCurrent
+XMesaMakeCurrent
+XMesaMakeCurrent2
+XMesaReset
+XMesaSetFXmode
+XMesaSetVisualDisplay
+XMesaSwapBuffers
+XMesaUnbindContext
+xmesa_alloc_back_buffer
+xmesa_color_to_pixel
+xmesa_update_state
+xmesa_get_line_func
+xmesa_get_points_func
+xmesa_get_triangle_func
+
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/GLcore-def.cpp,v 1.1 2000/08/10 17:40:29 dawes Exp $ */
diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c
new file mode 100644
index 000000000..4e03b59fe
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c
@@ -0,0 +1,64 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/GLcoremodule.c,v 1.5 2000/02/23 04:46:55 martin Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(GLcoreSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "GLcore",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL };
+
+static pointer
+GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* Need a non-NULL return value to indicate success */
+ return (pointer)1;
+}
diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile
new file mode 100644
index 000000000..154a5c1a0
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile
@@ -0,0 +1,77 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.3 2002/05/31 18:12:36 dawes Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define MesaInXServer
+#define MesaBuildDir ../main/
+#define MesaACBuildDir ../array_cache/
+#define MesaMathBuildDir ../math/
+#define MesaSwrastBuildDir ../swrast/
+#define MesaSwrastSetupBuildDir ../swrast_setup/
+#define MesaTnlBuildDir ../tnl/
+#define MesaShaderBuildDir ../shader/
+#define MesaGrammarBuildDir ../shader/grammar/
+#define MesaSlangBuildDir ../shader/slang/
+#define MesaXBuildDir ../X/
+
+#include "../../../../../lib/GL/mesa/array_cache/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/swrast/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/tnl/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/math/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/shader/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/shader/slang/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#include "../../../../../lib/GL/mesa/Imakefile.inc"
+
+#ifdef IHaveModules
+ MSRCS = GLcoremodule.c
+ MOBJS = GLcoremodule.o
+#endif
+
+ XOBJS = ../X/?*.o
+
+ OBJS = $(COREMESAOBJS) $(MOBJS)
+
+ DONES = ../main/DONE ../X/DONE ../array_cache/DONE \
+ ../math/DONE ../swrast/DONE ../swrast_setup/DONE \
+ ../tnl/DONE ../shader/DONE ../shader/grammar/DONE \
+ ../shader/slang/DONE
+
+ INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(SERVERSRC)/include
+
+ DEFINES = $(GLX_DEFINES)
+
+#ifdef IHaveModules
+ModuleObjectRule()
+
+DepLibraryModuleTarget(GLcore, $(DONES) $(OBJS),$(OBJS) $(XOBJS))
+InstallLibraryModule(GLcore,$(MODULEDIR),extensions)
+
+#else
+NormalDepLibraryTarget(GLcore, $(DONES) $(OBJS), $(OBJS) $(XOBJS))
+NormalLibraryObjectRule()
+#endif
+
+InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions)
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile
new file mode 100644
index 000000000..18dcdf0a1
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile
@@ -0,0 +1,53 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.2 2002/02/25 18:00:38 dawes Exp $
+
+#define IHaveModules
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define MesaInXServer
+#define MesaBuildDir ../../main/module/
+#define MesaACBuildDir ../../array_cache/module/
+#define MesaMathBuildDir ../../math/module/
+#define MesaSwrastBuildDir ../../swrast/module/
+#define MesaSwrastSetupBuildDir ../../swrast_setup/module/
+#define MesaTnlBuildDir ../../tnl/module/
+#define MesaXBuildDir ../../X/module/
+
+#include "../../../../../../lib/GL/mesa/array_cache/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/swrast/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/tnl/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/math/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#include "../../../../../../lib/GL/mesa/Imakefile.inc"
+
+#if DoLoadableServer
+ MSRCS = GLcoremodule.c
+ MOBJS = GLcoremodule.o
+#endif
+
+ XOBJS = ../../X/module/?*.o
+
+ OBJS = $(COREMESAOBJS) $(MOBJS)
+
+ DONES = ../../module/DONE ../../X/module/DONE \
+ ../../array_cache/module/DONE ../../math/module/DONE \
+ ../../swrast/module/DONE \
+ ../../swrast_setup/module/DONE ../../tnl/module/DONE
+
+ INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(SERVERSRC)/include
+
+ DEFINES = $(GLX_DEFINES)
+
+ModuleObjectRule()
+
+DepLibraryModuleTarget(GLcore, $(DONES) $(OBJS),$(OBJS) $(XOBJS))
+InstallLibraryModule(GLcore,$(MODULEDIR),extensions)
+
+InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions)
+
+LinkSourceFile(GLcoremodule.c,..)
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile b/nx-X11/programs/Xserver/GL/mesa/Imakefile
new file mode 100644
index 000000000..ea7d18aa2
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile
@@ -0,0 +1,47 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/Imakefile,v 1.23 2002/11/22 22:56:00 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+ MODSUBDIR = module
+#endif
+#endif
+
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#define IHaveSubdirs
+ SUBDIRS = main math array_cache swrast swrast_setup tnl shader X GLcore $(MODSUBDIR)
+#endif
+
+#include <Server.tmpl>
+
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../lib/GL/mesa/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/Imakefile.inc"
+#endif
+
+ INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(SERVERSRC)/include
+
+ DEFINES = $(GLX_DEFINES)
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
+DependTarget()
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile
new file mode 100644
index 000000000..f0e722f00
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile
@@ -0,0 +1,93 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaXBuildDir /**/
+#define MesaInXServer
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#endif
+
+
+LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
+
+ DRIVER_SRCS = $(XMESA_SRCS)
+ DRIVER_OBJS = $(XMESA_OBJS)
+
+ COMMON_SRCS = driverfuncs.c
+ COMMON_OBJS = driverfuncs.o
+
+#ifndef XFree86Version
+
+/* This appears to be the quickest way to build a non-XFree86 server */
+GLXSRV_DEFINES = -DXFree86Server
+
+#endif
+
+ GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
+ GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
+
+ SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
+ OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
+
+ INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
+ -I$(MESASRCDIR)/include \
+ -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
+ -I$(SERVERSRC)/GL/glx \
+ -I$(XF86OSSRC) \
+ -I$(DRMSRCDIR)/shared-core
+
+ DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
+#if defined(IHaveModules) && BuildModuleInSubdir
+LinkSourceFile(xf86glx.c,..)
+LinkSourceFile(xf86glx_util.c,..)
+#endif
+
+#ifndef MesaDrvSrcDir
+#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
+#endif
+
+MESADRVSRCDIR = MesaDrvSrcDir
+
+
+LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
+LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.NX.original b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.NX.original
new file mode 100644
index 000000000..f0e722f00
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.NX.original
@@ -0,0 +1,93 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaXBuildDir /**/
+#define MesaInXServer
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#endif
+
+
+LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
+
+ DRIVER_SRCS = $(XMESA_SRCS)
+ DRIVER_OBJS = $(XMESA_OBJS)
+
+ COMMON_SRCS = driverfuncs.c
+ COMMON_OBJS = driverfuncs.o
+
+#ifndef XFree86Version
+
+/* This appears to be the quickest way to build a non-XFree86 server */
+GLXSRV_DEFINES = -DXFree86Server
+
+#endif
+
+ GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
+ GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
+
+ SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
+ OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
+
+ INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
+ -I$(MESASRCDIR)/include \
+ -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
+ -I$(SERVERSRC)/GL/glx \
+ -I$(XF86OSSRC) \
+ -I$(DRMSRCDIR)/shared-core
+
+ DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
+#if defined(IHaveModules) && BuildModuleInSubdir
+LinkSourceFile(xf86glx.c,..)
+LinkSourceFile(xf86glx_util.c,..)
+#endif
+
+#ifndef MesaDrvSrcDir
+#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
+#endif
+
+MESADRVSRCDIR = MesaDrvSrcDir
+
+
+LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
+LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original
new file mode 100644
index 000000000..57fb7ff36
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original
@@ -0,0 +1,93 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaXBuildDir /**/
+#define MesaInXServer
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
+#endif
+
+
+LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
+
+ DRIVER_SRCS = $(XMESA_SRCS)
+ DRIVER_OBJS = $(XMESA_OBJS)
+
+ COMMON_SRCS = driverfuncs.c
+ COMMON_OBJS = driverfuncs.o
+
+#ifndef XFree86Version
+
+/* This appears to be the quickest way to build a non-XFree86 server */
+GLXSRV_DEFINES = -DXFree86Server
+
+#endif
+
+ GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
+ GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
+
+ SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
+ OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
+
+ INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
+ -I$(MESASRCDIR)/include \
+ -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
+ -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
+ -I$(SERVERSRC)/GL/glx \
+ -I$(XF86OSSRC) \
+ -I$(DRMSRCDIR)/shared-core
+
+ DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
+#if defined(IHaveModules) && BuildModuleInSubdir
+LinkSourceFile(xf86glx.c,..)
+LinkSourceFile(xf86glx_util.c,..)
+#endif
+
+#ifndef MesaDrvSrcDir
+#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
+#endif
+
+MESADRVSRCDIR = MesaDrvSrcDir
+
+
+LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
+LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile
new file mode 100644
index 000000000..eee4c7556
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/module/Imakefile,v 1.1 2002/05/31 18:12:38 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c
new file mode 100644
index 000000000..19b5be637
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c
@@ -0,0 +1,952 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian E. Paul <brian@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <regionstr.h>
+#include <resource.h>
+#include <GL/gl.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <config.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include "xf86glxint.h"
+#include "context.h"
+#include "xmesaP.h"
+#include <GL/xf86glx.h>
+#include "context.h"
+
+/*
+ * This define is for the glcore.h header file.
+ * If you add it here, then make sure you also add it in
+ * ../../../glx/Imakefile.
+ */
+#if 0
+#define DEBUG
+#include <GL/internal/glcore.h>
+#undef DEBUG
+#else
+#include <GL/internal/glcore.h>
+#endif
+
+#include "glcontextmodes.h"
+
+#ifdef NXAGENT_SERVER
+#include "../main/WSDrawBuffer.h"
+#endif
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ __MESA_screenProbe, /* Must be generic and handle all screens */
+ __MESA_createContext, /* Substitute screen's createContext routine */
+ __MESA_createBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up modes in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ NULL, /* GLextensions is overwritten by __glXScreenInit */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+#ifdef NXAGENT_SERVER
+WSDrawBufferPtr pWSDrawBuffer = NULL;
+
+void AddWSDrawBuffer(GLframebuffer *mesa_buffer)
+{
+ WSDrawBufferPtr prevWSDB;
+ WSDrawBufferPtr newWSDB;
+ WSDrawBufferPtr p;
+
+ prevWSDB = NULL;
+ newWSDB = NULL;
+ p = pWSDrawBuffer;
+ while (p != NULL) {
+ prevWSDB = p;
+ if (prevWSDB -> DrawBuffer == mesa_buffer) {
+ return;
+ }
+ p = p -> next;
+ }
+ newWSDB = malloc(sizeof(WSDrawBufferRec));
+ newWSDB -> DrawBuffer = mesa_buffer;
+ newWSDB -> next = NULL;
+
+ if (pWSDrawBuffer == NULL)
+ pWSDrawBuffer = newWSDB;
+ else
+ prevWSDB -> next = newWSDB;
+}
+#endif
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_MESA,
+ __MESA_resetExtension,
+ __MESA_initVisuals,
+ __MESA_setVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+static __MESA_screen MESAScreens[MAXSCREENS];
+static __GLcontext *MESA_CC = NULL;
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+
+static int count_bits(unsigned int n)
+{
+ int bits = 0;
+
+ while (n > 0) {
+ if (n & 1) bits++;
+ n >>= 1;
+ }
+ return bits;
+}
+
+
+static XMesaVisual find_mesa_visual(int screen, VisualID vid)
+{
+ __MESA_screen * const pMScr = &MESAScreens[screen];
+ const __GLcontextModes *modes;
+ unsigned i = 0;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ if ( modes->visualID == vid ) {
+ break;
+ }
+
+ i++;
+ }
+
+ return (modes != NULL) ? pMScr->xm_vis[i] : NULL;
+}
+
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ numNewVisuals +=
+ (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ MESAScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp, int *rootDepthp,
+ VisualID *defaultVisp, unsigned long sizes,
+ int bitsPerRGB)
+{
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __MESA_screen *pMScr = &MESAScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ XMesaVisual *pXMesaVisual;
+ int *used;
+ int i, j;
+
+ /* Alloc space for the list of XMesa visuals */
+ pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis *
+ sizeof(XMesaVisual));
+ __glXMemset(pXMesaVisual, 0,
+ MESAScreens[screen].num_vis * sizeof(XMesaVisual));
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = MESAScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* Create the XMesa visual */
+ pXMesaVisual[i] =
+ XMesaCreateVisual(pScreen,
+ pVis,
+ modes->rgbMode,
+ (modes->alphaBits > 0),
+ modes->doubleBufferMode,
+ modes->stereoMode,
+ GL_TRUE, /* ximage_flag */
+ modes->depthBits,
+ modes->stencilBits,
+ modes->accumRedBits,
+ modes->accumGreenBits,
+ modes->accumBlueBits,
+ modes->accumAlphaBits,
+ modes->samples,
+ modes->level,
+ modes->visualRating);
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ modes->visualType,
+ (modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ __glXFree(used);
+
+ MESAScreens[screen].xm_vis = pXMesaVisual;
+}
+
+Bool __MESA_screenProbe(int screen)
+{
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = MESAScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = __MESA_createContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ return TRUE;
+}
+
+extern void __MESA_resetExtension(void)
+{
+ int i, j;
+
+ XMesaReset();
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ for (j = 0; j < MESAScreens[i].num_vis; j++) {
+ if (MESAScreens[i].xm_vis[j]) {
+ XMesaDestroyVisual(MESAScreens[i].xm_vis[j]);
+ MESAScreens[i].xm_vis[j] = NULL;
+ }
+ }
+ _gl_context_modes_destroy( MESAScreens[i].modes );
+ MESAScreens[i].modes = NULL;
+ __glXFree(MESAScreens[i].private);
+ MESAScreens[i].private = NULL;
+ __glXFree(MESAScreens[i].xm_vis);
+ MESAScreens[i].xm_vis = NULL;
+ MESAScreens[i].num_vis = 0;
+ }
+ __glDDXScreenInfo.modes = NULL;
+ MESA_CC = NULL;
+}
+
+void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ DrawablePtr pDraw = glxPriv->pDraw;
+ XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum,
+ glxPriv->modes->visualID);
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ __MESA_buffer buf;
+
+ if (xm_vis == NULL) {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxPriv->modes->visualID);
+ }
+ buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec));
+
+ /* Create Mesa's buffers */
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis,
+ (WindowPtr)pDraw);
+ } else {
+ buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis,
+ (PixmapPtr)pDraw, 0);
+ }
+
+ /* Wrap the front buffer's resize routine */
+ buf->fbresize = glPriv->frontBuffer.resize;
+ glPriv->frontBuffer.resize = __MESA_resizeBuffers;
+
+ /* Wrap the swap buffers routine */
+ buf->fbswap = glxPriv->swapBuffers;
+ glxPriv->swapBuffers = __MESA_swapBuffers;
+
+ /* Save Mesa's private buffer structure */
+ glPriv->private = (void *)buf;
+ glPriv->freePrivate = __MESA_destroyBuffer;
+}
+
+GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
+ GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+
+ if (buf->xm_buf)
+ XMesaResizeBuffers(buf->xm_buf);
+
+ return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask);
+}
+
+GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private;
+
+ /*
+ ** Do not call the wrapped swap buffers routine since Mesa has
+ ** already done the swap.
+ */
+ XMesaSwapBuffers(buf->xm_buf);
+
+ return GL_TRUE;
+}
+
+void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+#ifdef NXAGENT_SERVER
+ AddWSDrawBuffer(& (buf -> xm_buf -> mesa_buffer) );
+#endif
+
+ /* Destroy Mesa's buffers */
+ if (buf->xm_buf)
+ XMesaDestroyBuffer(buf->xm_buf);
+
+ /* Unwrap these routines */
+ glxPriv->swapBuffers = buf->fbswap;
+ glPriv->frontBuffer.resize = buf->fbresize;
+
+ __glXFree(glPriv->private);
+ glPriv->private = NULL;
+}
+
+__GLinterface *__MESA_createContext(__GLimports *imports,
+ __GLcontextModes *modes,
+ __GLinterface *shareGC)
+{
+ __GLcontext *gl_ctx = NULL;
+ __GLcontext *m_share = NULL;
+ __GLXcontext *glxc = (__GLXcontext *)imports->other;
+ XMesaVisual xm_vis;
+
+ if (shareGC)
+ m_share = (__GLcontext *)shareGC;
+
+ xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID);
+ if (xm_vis) {
+ XMesaContext xmshare = m_share ? m_share->DriverCtx : 0;
+ XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare);
+ gl_ctx = xmctx ? &xmctx->mesa : 0;
+ }
+ else {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxc->modes->visualID);
+ }
+
+
+ if (!gl_ctx)
+ return NULL;
+
+ gl_ctx->imports = *imports;
+ gl_ctx->exports.destroyContext = __MESA_destroyContext;
+ gl_ctx->exports.loseCurrent = __MESA_loseCurrent;
+ gl_ctx->exports.makeCurrent = __MESA_makeCurrent;
+ gl_ctx->exports.shareContext = __MESA_shareContext;
+ gl_ctx->exports.copyContext = __MESA_copyContext;
+ gl_ctx->exports.forceCurrent = __MESA_forceCurrent;
+ gl_ctx->exports.notifyResize = __MESA_notifyResize;
+ gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy;
+ gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers;
+ gl_ctx->exports.dispatchExec = __MESA_dispatchExec;
+ gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride;
+ gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride;
+
+ return (__GLinterface *)gl_ctx;
+}
+
+GLboolean __MESA_destroyContext(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ XMesaDestroyContext( xmesa );
+ return GL_TRUE;
+}
+
+GLboolean __MESA_loseCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = NULL;
+ __glXLastContext = NULL;
+ return XMesaLoseCurrent(xmesa);
+}
+
+GLboolean __MESA_makeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc );
+ __MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private;
+ __GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc );
+ __MESA_buffer readBuf = (__MESA_buffer)readPriv->private;
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+
+ MESA_CC = gc;
+ return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf);
+}
+
+GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ /* NOT_DONE */
+ /* XXX I don't see where/how this could ever be called */
+ ErrorF("__MESA_shareContext\n");
+ return GL_FALSE;
+}
+
+GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ XMesaContext xm_dst = (XMesaContext) dst->DriverCtx;
+ const XMesaContext xm_src = (const XMesaContext) src->DriverCtx;
+ _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask);
+ return GL_TRUE;
+}
+
+GLboolean __MESA_forceCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = gc;
+ return XMesaForceCurrent(xmesa);
+}
+
+GLboolean __MESA_notifyResize(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyResize\n");
+ return GL_FALSE;
+}
+
+void __MESA_notifyDestroy(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyDestroy\n");
+ return;
+}
+
+void __MESA_notifySwapBuffers(__GLcontext *gc)
+{
+ _mesa_notifySwapBuffers(gc);
+}
+
+struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_dispatchExec\n");
+ return NULL;
+}
+
+void __MESA_beginDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_beginDispatchOverride\n");
+ return;
+}
+
+void __MESA_endDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_endDispatchOverride\n");
+ return;
+}
+
+
+/*
+ * Server-side GLX uses these functions which are normally defined
+ * in the OpenGL SI.
+ */
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original
new file mode 100644
index 000000000..19b5be637
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original
@@ -0,0 +1,952 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian E. Paul <brian@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <regionstr.h>
+#include <resource.h>
+#include <GL/gl.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <config.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include "xf86glxint.h"
+#include "context.h"
+#include "xmesaP.h"
+#include <GL/xf86glx.h>
+#include "context.h"
+
+/*
+ * This define is for the glcore.h header file.
+ * If you add it here, then make sure you also add it in
+ * ../../../glx/Imakefile.
+ */
+#if 0
+#define DEBUG
+#include <GL/internal/glcore.h>
+#undef DEBUG
+#else
+#include <GL/internal/glcore.h>
+#endif
+
+#include "glcontextmodes.h"
+
+#ifdef NXAGENT_SERVER
+#include "../main/WSDrawBuffer.h"
+#endif
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ __MESA_screenProbe, /* Must be generic and handle all screens */
+ __MESA_createContext, /* Substitute screen's createContext routine */
+ __MESA_createBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up modes in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ NULL, /* GLextensions is overwritten by __glXScreenInit */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+#ifdef NXAGENT_SERVER
+WSDrawBufferPtr pWSDrawBuffer = NULL;
+
+void AddWSDrawBuffer(GLframebuffer *mesa_buffer)
+{
+ WSDrawBufferPtr prevWSDB;
+ WSDrawBufferPtr newWSDB;
+ WSDrawBufferPtr p;
+
+ prevWSDB = NULL;
+ newWSDB = NULL;
+ p = pWSDrawBuffer;
+ while (p != NULL) {
+ prevWSDB = p;
+ if (prevWSDB -> DrawBuffer == mesa_buffer) {
+ return;
+ }
+ p = p -> next;
+ }
+ newWSDB = malloc(sizeof(WSDrawBufferRec));
+ newWSDB -> DrawBuffer = mesa_buffer;
+ newWSDB -> next = NULL;
+
+ if (pWSDrawBuffer == NULL)
+ pWSDrawBuffer = newWSDB;
+ else
+ prevWSDB -> next = newWSDB;
+}
+#endif
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_MESA,
+ __MESA_resetExtension,
+ __MESA_initVisuals,
+ __MESA_setVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+static __MESA_screen MESAScreens[MAXSCREENS];
+static __GLcontext *MESA_CC = NULL;
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+
+static int count_bits(unsigned int n)
+{
+ int bits = 0;
+
+ while (n > 0) {
+ if (n & 1) bits++;
+ n >>= 1;
+ }
+ return bits;
+}
+
+
+static XMesaVisual find_mesa_visual(int screen, VisualID vid)
+{
+ __MESA_screen * const pMScr = &MESAScreens[screen];
+ const __GLcontextModes *modes;
+ unsigned i = 0;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ if ( modes->visualID == vid ) {
+ break;
+ }
+
+ i++;
+ }
+
+ return (modes != NULL) ? pMScr->xm_vis[i] : NULL;
+}
+
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ numNewVisuals +=
+ (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ MESAScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp, int *rootDepthp,
+ VisualID *defaultVisp, unsigned long sizes,
+ int bitsPerRGB)
+{
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __MESA_screen *pMScr = &MESAScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ XMesaVisual *pXMesaVisual;
+ int *used;
+ int i, j;
+
+ /* Alloc space for the list of XMesa visuals */
+ pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis *
+ sizeof(XMesaVisual));
+ __glXMemset(pXMesaVisual, 0,
+ MESAScreens[screen].num_vis * sizeof(XMesaVisual));
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = MESAScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* Create the XMesa visual */
+ pXMesaVisual[i] =
+ XMesaCreateVisual(pScreen,
+ pVis,
+ modes->rgbMode,
+ (modes->alphaBits > 0),
+ modes->doubleBufferMode,
+ modes->stereoMode,
+ GL_TRUE, /* ximage_flag */
+ modes->depthBits,
+ modes->stencilBits,
+ modes->accumRedBits,
+ modes->accumGreenBits,
+ modes->accumBlueBits,
+ modes->accumAlphaBits,
+ modes->samples,
+ modes->level,
+ modes->visualRating);
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ modes->visualType,
+ (modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ __glXFree(used);
+
+ MESAScreens[screen].xm_vis = pXMesaVisual;
+}
+
+Bool __MESA_screenProbe(int screen)
+{
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = MESAScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = __MESA_createContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ return TRUE;
+}
+
+extern void __MESA_resetExtension(void)
+{
+ int i, j;
+
+ XMesaReset();
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ for (j = 0; j < MESAScreens[i].num_vis; j++) {
+ if (MESAScreens[i].xm_vis[j]) {
+ XMesaDestroyVisual(MESAScreens[i].xm_vis[j]);
+ MESAScreens[i].xm_vis[j] = NULL;
+ }
+ }
+ _gl_context_modes_destroy( MESAScreens[i].modes );
+ MESAScreens[i].modes = NULL;
+ __glXFree(MESAScreens[i].private);
+ MESAScreens[i].private = NULL;
+ __glXFree(MESAScreens[i].xm_vis);
+ MESAScreens[i].xm_vis = NULL;
+ MESAScreens[i].num_vis = 0;
+ }
+ __glDDXScreenInfo.modes = NULL;
+ MESA_CC = NULL;
+}
+
+void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ DrawablePtr pDraw = glxPriv->pDraw;
+ XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum,
+ glxPriv->modes->visualID);
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ __MESA_buffer buf;
+
+ if (xm_vis == NULL) {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxPriv->modes->visualID);
+ }
+ buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec));
+
+ /* Create Mesa's buffers */
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis,
+ (WindowPtr)pDraw);
+ } else {
+ buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis,
+ (PixmapPtr)pDraw, 0);
+ }
+
+ /* Wrap the front buffer's resize routine */
+ buf->fbresize = glPriv->frontBuffer.resize;
+ glPriv->frontBuffer.resize = __MESA_resizeBuffers;
+
+ /* Wrap the swap buffers routine */
+ buf->fbswap = glxPriv->swapBuffers;
+ glxPriv->swapBuffers = __MESA_swapBuffers;
+
+ /* Save Mesa's private buffer structure */
+ glPriv->private = (void *)buf;
+ glPriv->freePrivate = __MESA_destroyBuffer;
+}
+
+GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
+ GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+
+ if (buf->xm_buf)
+ XMesaResizeBuffers(buf->xm_buf);
+
+ return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask);
+}
+
+GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private;
+
+ /*
+ ** Do not call the wrapped swap buffers routine since Mesa has
+ ** already done the swap.
+ */
+ XMesaSwapBuffers(buf->xm_buf);
+
+ return GL_TRUE;
+}
+
+void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+#ifdef NXAGENT_SERVER
+ AddWSDrawBuffer(& (buf -> xm_buf -> mesa_buffer) );
+#endif
+
+ /* Destroy Mesa's buffers */
+ if (buf->xm_buf)
+ XMesaDestroyBuffer(buf->xm_buf);
+
+ /* Unwrap these routines */
+ glxPriv->swapBuffers = buf->fbswap;
+ glPriv->frontBuffer.resize = buf->fbresize;
+
+ __glXFree(glPriv->private);
+ glPriv->private = NULL;
+}
+
+__GLinterface *__MESA_createContext(__GLimports *imports,
+ __GLcontextModes *modes,
+ __GLinterface *shareGC)
+{
+ __GLcontext *gl_ctx = NULL;
+ __GLcontext *m_share = NULL;
+ __GLXcontext *glxc = (__GLXcontext *)imports->other;
+ XMesaVisual xm_vis;
+
+ if (shareGC)
+ m_share = (__GLcontext *)shareGC;
+
+ xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID);
+ if (xm_vis) {
+ XMesaContext xmshare = m_share ? m_share->DriverCtx : 0;
+ XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare);
+ gl_ctx = xmctx ? &xmctx->mesa : 0;
+ }
+ else {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxc->modes->visualID);
+ }
+
+
+ if (!gl_ctx)
+ return NULL;
+
+ gl_ctx->imports = *imports;
+ gl_ctx->exports.destroyContext = __MESA_destroyContext;
+ gl_ctx->exports.loseCurrent = __MESA_loseCurrent;
+ gl_ctx->exports.makeCurrent = __MESA_makeCurrent;
+ gl_ctx->exports.shareContext = __MESA_shareContext;
+ gl_ctx->exports.copyContext = __MESA_copyContext;
+ gl_ctx->exports.forceCurrent = __MESA_forceCurrent;
+ gl_ctx->exports.notifyResize = __MESA_notifyResize;
+ gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy;
+ gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers;
+ gl_ctx->exports.dispatchExec = __MESA_dispatchExec;
+ gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride;
+ gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride;
+
+ return (__GLinterface *)gl_ctx;
+}
+
+GLboolean __MESA_destroyContext(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ XMesaDestroyContext( xmesa );
+ return GL_TRUE;
+}
+
+GLboolean __MESA_loseCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = NULL;
+ __glXLastContext = NULL;
+ return XMesaLoseCurrent(xmesa);
+}
+
+GLboolean __MESA_makeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc );
+ __MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private;
+ __GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc );
+ __MESA_buffer readBuf = (__MESA_buffer)readPriv->private;
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+
+ MESA_CC = gc;
+ return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf);
+}
+
+GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ /* NOT_DONE */
+ /* XXX I don't see where/how this could ever be called */
+ ErrorF("__MESA_shareContext\n");
+ return GL_FALSE;
+}
+
+GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ XMesaContext xm_dst = (XMesaContext) dst->DriverCtx;
+ const XMesaContext xm_src = (const XMesaContext) src->DriverCtx;
+ _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask);
+ return GL_TRUE;
+}
+
+GLboolean __MESA_forceCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = gc;
+ return XMesaForceCurrent(xmesa);
+}
+
+GLboolean __MESA_notifyResize(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyResize\n");
+ return GL_FALSE;
+}
+
+void __MESA_notifyDestroy(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyDestroy\n");
+ return;
+}
+
+void __MESA_notifySwapBuffers(__GLcontext *gc)
+{
+ _mesa_notifySwapBuffers(gc);
+}
+
+struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_dispatchExec\n");
+ return NULL;
+}
+
+void __MESA_beginDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_beginDispatchOverride\n");
+ return;
+}
+
+void __MESA_endDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_endDispatchOverride\n");
+ return;
+}
+
+
+/*
+ * Server-side GLX uses these functions which are normally defined
+ * in the OpenGL SI.
+ */
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original
new file mode 100644
index 000000000..5dd4e7c37
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original
@@ -0,0 +1,914 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian E. Paul <brian@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <regionstr.h>
+#include <resource.h>
+#include <GL/gl.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <config.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include "xf86glxint.h"
+#include "context.h"
+#include "xmesaP.h"
+#include <GL/xf86glx.h>
+#include "context.h"
+
+/*
+ * This define is for the glcore.h header file.
+ * If you add it here, then make sure you also add it in
+ * ../../../glx/Imakefile.
+ */
+#if 0
+#define DEBUG
+#include <GL/internal/glcore.h>
+#undef DEBUG
+#else
+#include <GL/internal/glcore.h>
+#endif
+
+#include "glcontextmodes.h"
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ __MESA_screenProbe, /* Must be generic and handle all screens */
+ __MESA_createContext, /* Substitute screen's createContext routine */
+ __MESA_createBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up modes in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ NULL, /* GLextensions is overwritten by __glXScreenInit */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_MESA,
+ __MESA_resetExtension,
+ __MESA_initVisuals,
+ __MESA_setVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+static __MESA_screen MESAScreens[MAXSCREENS];
+static __GLcontext *MESA_CC = NULL;
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+
+static int count_bits(unsigned int n)
+{
+ int bits = 0;
+
+ while (n > 0) {
+ if (n & 1) bits++;
+ n >>= 1;
+ }
+ return bits;
+}
+
+
+static XMesaVisual find_mesa_visual(int screen, VisualID vid)
+{
+ __MESA_screen * const pMScr = &MESAScreens[screen];
+ const __GLcontextModes *modes;
+ unsigned i = 0;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ if ( modes->visualID == vid ) {
+ break;
+ }
+
+ i++;
+ }
+
+ return (modes != NULL) ? pMScr->xm_vis[i] : NULL;
+}
+
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ numNewVisuals +=
+ (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ MESAScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp, int *rootDepthp,
+ VisualID *defaultVisp, unsigned long sizes,
+ int bitsPerRGB)
+{
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __MESA_screen *pMScr = &MESAScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ XMesaVisual *pXMesaVisual;
+ int *used;
+ int i, j;
+
+ /* Alloc space for the list of XMesa visuals */
+ pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis *
+ sizeof(XMesaVisual));
+ __glXMemset(pXMesaVisual, 0,
+ MESAScreens[screen].num_vis * sizeof(XMesaVisual));
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = MESAScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* Create the XMesa visual */
+ pXMesaVisual[i] =
+ XMesaCreateVisual(pScreen,
+ pVis,
+ modes->rgbMode,
+ (modes->alphaBits > 0),
+ modes->doubleBufferMode,
+ modes->stereoMode,
+ GL_TRUE, /* ximage_flag */
+ modes->depthBits,
+ modes->stencilBits,
+ modes->accumRedBits,
+ modes->accumGreenBits,
+ modes->accumBlueBits,
+ modes->accumAlphaBits,
+ modes->samples,
+ modes->level,
+ modes->visualRating);
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ modes->visualType,
+ (modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ __glXFree(used);
+
+ MESAScreens[screen].xm_vis = pXMesaVisual;
+}
+
+Bool __MESA_screenProbe(int screen)
+{
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = MESAScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = __MESA_createContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ return TRUE;
+}
+
+extern void __MESA_resetExtension(void)
+{
+ int i, j;
+
+ XMesaReset();
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ for (j = 0; j < MESAScreens[i].num_vis; j++) {
+ if (MESAScreens[i].xm_vis[j]) {
+ XMesaDestroyVisual(MESAScreens[i].xm_vis[j]);
+ MESAScreens[i].xm_vis[j] = NULL;
+ }
+ }
+ _gl_context_modes_destroy( MESAScreens[i].modes );
+ MESAScreens[i].modes = NULL;
+ __glXFree(MESAScreens[i].private);
+ MESAScreens[i].private = NULL;
+ __glXFree(MESAScreens[i].xm_vis);
+ MESAScreens[i].xm_vis = NULL;
+ MESAScreens[i].num_vis = 0;
+ }
+ __glDDXScreenInfo.modes = NULL;
+ MESA_CC = NULL;
+}
+
+void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ DrawablePtr pDraw = glxPriv->pDraw;
+ XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum,
+ glxPriv->modes->visualID);
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ __MESA_buffer buf;
+
+ if (xm_vis == NULL) {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxPriv->modes->visualID);
+ }
+ buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec));
+
+ /* Create Mesa's buffers */
+ if (glxPriv->type == DRAWABLE_WINDOW) {
+ buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis,
+ (WindowPtr)pDraw);
+ } else {
+ buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis,
+ (PixmapPtr)pDraw, 0);
+ }
+
+ /* Wrap the front buffer's resize routine */
+ buf->fbresize = glPriv->frontBuffer.resize;
+ glPriv->frontBuffer.resize = __MESA_resizeBuffers;
+
+ /* Wrap the swap buffers routine */
+ buf->fbswap = glxPriv->swapBuffers;
+ glxPriv->swapBuffers = __MESA_swapBuffers;
+
+ /* Save Mesa's private buffer structure */
+ glPriv->private = (void *)buf;
+ glPriv->freePrivate = __MESA_destroyBuffer;
+}
+
+GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
+ GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+
+ if (buf->xm_buf)
+ XMesaResizeBuffers(buf->xm_buf);
+
+ return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask);
+}
+
+GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private;
+
+ /*
+ ** Do not call the wrapped swap buffers routine since Mesa has
+ ** already done the swap.
+ */
+ XMesaSwapBuffers(buf->xm_buf);
+
+ return GL_TRUE;
+}
+
+void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv)
+{
+ __MESA_buffer buf = (__MESA_buffer)glPriv->private;
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+ /* Destroy Mesa's buffers */
+ if (buf->xm_buf)
+ XMesaDestroyBuffer(buf->xm_buf);
+
+ /* Unwrap these routines */
+ glxPriv->swapBuffers = buf->fbswap;
+ glPriv->frontBuffer.resize = buf->fbresize;
+
+ __glXFree(glPriv->private);
+ glPriv->private = NULL;
+}
+
+__GLinterface *__MESA_createContext(__GLimports *imports,
+ __GLcontextModes *modes,
+ __GLinterface *shareGC)
+{
+ __GLcontext *gl_ctx = NULL;
+ __GLcontext *m_share = NULL;
+ __GLXcontext *glxc = (__GLXcontext *)imports->other;
+ XMesaVisual xm_vis;
+
+ if (shareGC)
+ m_share = (__GLcontext *)shareGC;
+
+ xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID);
+ if (xm_vis) {
+ XMesaContext xmshare = m_share ? m_share->DriverCtx : 0;
+ XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare);
+ gl_ctx = xmctx ? &xmctx->mesa : 0;
+ }
+ else {
+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
+ glxc->modes->visualID);
+ }
+
+
+ if (!gl_ctx)
+ return NULL;
+
+ gl_ctx->imports = *imports;
+ gl_ctx->exports.destroyContext = __MESA_destroyContext;
+ gl_ctx->exports.loseCurrent = __MESA_loseCurrent;
+ gl_ctx->exports.makeCurrent = __MESA_makeCurrent;
+ gl_ctx->exports.shareContext = __MESA_shareContext;
+ gl_ctx->exports.copyContext = __MESA_copyContext;
+ gl_ctx->exports.forceCurrent = __MESA_forceCurrent;
+ gl_ctx->exports.notifyResize = __MESA_notifyResize;
+ gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy;
+ gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers;
+ gl_ctx->exports.dispatchExec = __MESA_dispatchExec;
+ gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride;
+ gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride;
+
+ return (__GLinterface *)gl_ctx;
+}
+
+GLboolean __MESA_destroyContext(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ XMesaDestroyContext( xmesa );
+ return GL_TRUE;
+}
+
+GLboolean __MESA_loseCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = NULL;
+ __glXLastContext = NULL;
+ return XMesaLoseCurrent(xmesa);
+}
+
+GLboolean __MESA_makeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc );
+ __MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private;
+ __GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc );
+ __MESA_buffer readBuf = (__MESA_buffer)readPriv->private;
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+
+ MESA_CC = gc;
+ return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf);
+}
+
+GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ /* NOT_DONE */
+ /* XXX I don't see where/how this could ever be called */
+ ErrorF("__MESA_shareContext\n");
+ return GL_FALSE;
+}
+
+GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ XMesaContext xm_dst = (XMesaContext) dst->DriverCtx;
+ const XMesaContext xm_src = (const XMesaContext) src->DriverCtx;
+ _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask);
+ return GL_TRUE;
+}
+
+GLboolean __MESA_forceCurrent(__GLcontext *gc)
+{
+ XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
+ MESA_CC = gc;
+ return XMesaForceCurrent(xmesa);
+}
+
+GLboolean __MESA_notifyResize(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyResize\n");
+ return GL_FALSE;
+}
+
+void __MESA_notifyDestroy(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_notifyDestroy\n");
+ return;
+}
+
+void __MESA_notifySwapBuffers(__GLcontext *gc)
+{
+ _mesa_notifySwapBuffers(gc);
+}
+
+struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_dispatchExec\n");
+ return NULL;
+}
+
+void __MESA_beginDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_beginDispatchOverride\n");
+ return;
+}
+
+void __MESA_endDispatchOverride(__GLcontext *gc)
+{
+ /* NOT_DONE */
+ ErrorF("__MESA_endDispatchOverride\n");
+ return;
+}
+
+
+/*
+ * Server-side GLX uses these functions which are normally defined
+ * in the OpenGL SI.
+ */
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c
new file mode 100644
index 000000000..6441a4b4f
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c
@@ -0,0 +1,151 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx_util.c,v 1.5 2000/03/02 16:07:39 martin Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian Paul <brian@precisioninsight.com>
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <gcstruct.h>
+#include "pixmapstr.h"
+#include "xf86glx_util.h"
+#include <X11/Xmd.h>
+#include "GL/xf86glx.h"
+
+#ifdef ROUNDUP
+#undef ROUNDUP
+#endif
+
+#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
+
+XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data)
+{
+ XMesaImage *image;
+
+ image = (XMesaImage *)xalloc(sizeof(XMesaImage));
+
+ if (image) {
+ image->width = width;
+ image->height = height;
+ image->data = data;
+ /* Always pad to 32 bits */
+ image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32);
+ image->bits_per_pixel = bitsPerPixel;
+ }
+
+ return image;
+}
+
+void XMesaDestroyImage(XMesaImage *image)
+{
+ if (image->data)
+ free(image->data);
+ xfree(image);
+}
+
+unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
+{
+ CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
+ CARD8 *i8;
+ CARD16 *i16;
+ CARD32 *i32;
+ switch (image->bits_per_pixel) {
+ case 8:
+ i8 = (CARD8 *)row;
+ return i8[x];
+ break;
+ case 15:
+ case 16:
+ i16 = (CARD16 *)row;
+ return i16[x];
+ break;
+ case 24: /* WARNING: architecture specific code */
+ i8 = (CARD8 *)row;
+ return (((CARD32)i8[x*3]) |
+ (((CARD32)i8[x*3+1])<<8) |
+ (((CARD32)i8[x*3+2])<<16));
+ break;
+ case 32:
+ i32 = (CARD32 *)row;
+ return i32[x];
+ break;
+ }
+ return 0;
+}
+
+#ifndef XMESA_USE_PUTPIXEL_MACRO
+void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel)
+{
+ CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
+ CARD8 *i8;
+ CARD16 *i16;
+ CARD32 *i32;
+ switch (image->bits_per_pixel) {
+ case 8:
+ i8 = (CARD8 *)row;
+ i8[x] = (CARD8)pixel;
+ break;
+ case 15:
+ case 16:
+ i16 = (CARD16 *)row;
+ i16[x] = (CARD16)pixel;
+ break;
+ case 24: /* WARNING: architecture specific code */
+ i8 = (CARD8 *)__row;
+ i8[x*3] = (CARD8)(p);
+ i8[x*3+1] = (CARD8)(p>>8);
+ i8[x*3+2] = (CARD8)(p>>16);
+ case 32:
+ i32 = (CARD32 *)row;
+ i32[x] = (CARD32)pixel;
+ break;
+ }
+}
+#endif
+
+void XMesaPutImageHelper(ScreenPtr display,
+ DrawablePtr d, GCPtr gc,
+ XMesaImage *image,
+ int src_x, int src_y,
+ int dest_x, int dest_y,
+ unsigned int width, unsigned int height)
+{
+ /* NOT_DONE: Verify that the following works for all depths */
+ char *src = (image->data +
+ src_y * image->bytes_per_line +
+ ((src_x * image->bits_per_pixel) >> 3));
+
+ ValidateGC(d, gc);
+ (*gc->ops->PutImage)(d, gc, d->depth, dest_x, dest_y, width, height,
+ 0, ZPixmap, src);
+}
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h
new file mode 100644
index 000000000..809c1550f
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h
@@ -0,0 +1,106 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx_util.h,v 1.5 2000/08/10 17:40:29 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian Paul <brian@precisioninsight.com>
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _XF86GLX_UTIL_H_
+#define _XF86GLX_UTIL_H_
+
+#ifdef __CYGWIN__
+#undef WIN32
+#undef _WIN32
+#endif
+
+#include <screenint.h>
+#include <pixmap.h>
+#include <gc.h>
+#include "GL/xmesa.h"
+
+#define XMESA_USE_PUTPIXEL_MACRO
+
+struct _XMesaImageRec {
+ int width, height;
+ char *data;
+ int bytes_per_line; /* Padded to 32 bits */
+ int bits_per_pixel;
+};
+
+extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height,
+ char *data);
+extern void XMesaDestroyImage(XMesaImage *image);
+extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y);
+#ifdef XMESA_USE_PUTPIXEL_MACRO
+#define XMesaPutPixel(__i,__x,__y,__p) \
+{ \
+ CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \
+ CARD8 *__i8; \
+ CARD16 *__i16; \
+ CARD32 *__i32; \
+ switch (__i->bits_per_pixel) { \
+ case 8: \
+ __i8 = (CARD8 *)__row; \
+ __i8[__x] = (CARD8)__p; \
+ break; \
+ case 15: \
+ case 16: \
+ __i16 = (CARD16 *)__row; \
+ __i16[__x] = (CARD16)__p; \
+ break; \
+ case 24: /* WARNING: architecture specific code */ \
+ __i8 = (CARD8 *)__row; \
+ __i8[__x*3] = (CARD8)(__p); \
+ __i8[__x*3+1] = (CARD8)(__p>>8); \
+ __i8[__x*3+2] = (CARD8)(__p>>16); \
+ break; \
+ case 32: \
+ __i32 = (CARD32 *)__row; \
+ __i32[__x] = (CARD32)__p; \
+ break; \
+ } \
+}
+#else
+extern void XMesaPutPixel(XMesaImage *image, int x, int y,
+ unsigned long pixel);
+#endif
+
+extern void XMesaPutImageHelper(ScreenPtr display,
+ DrawablePtr d, GCPtr gc,
+ XMesaImage *image,
+ int src_x, int src_y,
+ int dest_x, int dest_y,
+ unsigned int width, unsigned int height);
+
+#endif /* _XF86GLX_UTIL_H_ */
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h b/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h
new file mode 100644
index 000000000..974ff0364
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h
@@ -0,0 +1,102 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h,v 1.4 2002/02/22 21:45:08 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _XF86GLXINT_H_
+#define _XF86GLXINT_H_
+
+#include <miscstruct.h>
+#include <GL/gl.h>
+#include <GL/xmesa.h>
+
+typedef struct __MESA_screenRec __MESA_screen;
+struct __MESA_screenRec {
+ int num_vis;
+ __GLcontextModes *modes;
+ XMesaVisual *xm_vis;
+ void **private;
+};
+
+typedef struct __MESA_bufferRec *__MESA_buffer;
+struct __MESA_bufferRec {
+ XMesaBuffer xm_buf;
+ GLboolean (*fbresize)(__GLdrawableBuffer *buf,
+ GLint x, GLint y, GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv, GLuint bufferMask);
+ GLboolean (*fbswap)(__GLXdrawablePrivate *glxPriv);
+};
+
+extern void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates);
+extern Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp, int *rootDepthp,
+ VisualID *defaultVisp, unsigned long sizes,
+ int bitsPerRGB);
+extern Bool __MESA_screenProbe(int screen);
+
+extern void __MESA_resetExtension(void);
+
+extern void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv);
+extern GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buf,
+ GLint x, GLint y,
+ GLuint width, GLuint height,
+ __GLdrawablePrivate *glPriv,
+ GLuint bufferMask);
+extern GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv);
+extern void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv);
+
+extern __GLinterface *__MESA_createContext(__GLimports *imports,
+ __GLcontextModes *modes,
+ __GLinterface *shareGC);
+extern GLboolean __MESA_destroyContext(__GLcontext *gc);
+extern GLboolean __MESA_loseCurrent(__GLcontext *gc);
+extern GLboolean __MESA_makeCurrent(__GLcontext *gc);
+extern GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare);
+extern GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask);
+extern GLboolean __MESA_forceCurrent(__GLcontext *gc);
+
+extern GLboolean __MESA_notifyResize(__GLcontext *gc);
+extern void __MESA_notifyDestroy(__GLcontext *gc);
+extern void __MESA_notifySwapBuffers(__GLcontext *gc);
+extern struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc);
+extern void __MESA_beginDispatchOverride(__GLcontext *gc);
+extern void __MESA_endDispatchOverride(__GLcontext *gc);
+
+extern GLuint __glFloorLog2(GLuint val);
+
+#endif /* _XF86GLXINT_H_ */
diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile
new file mode 100644
index 000000000..8126c3f30
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile
@@ -0,0 +1,56 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/array_cache/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaACBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/array_cache/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/array_cache/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_AC_SRCS)
+ OBJS = $(MESA_AC_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/array_cache \
+ -I$(MESASRCDIR)/src/mesa/math \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile
new file mode 100644
index 000000000..86c585012
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/array_cache/module/Imakefile,v 1.1 2002/05/31 18:12:39 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile
new file mode 100644
index 000000000..6287b92de
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile
@@ -0,0 +1,61 @@
+XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+/* Large PIC tables needed for Solaris/SPARC builds */
+#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/main/Imakefile.inc"
+#endif
+
+ SRCS = $(COREMESABASESRCS)
+ OBJS = $(COREMESABASEOBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original
new file mode 100644
index 000000000..6287b92de
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original
@@ -0,0 +1,61 @@
+XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+/* Large PIC tables needed for Solaris/SPARC builds */
+#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/main/Imakefile.inc"
+#endif
+
+ SRCS = $(COREMESABASESRCS)
+ OBJS = $(COREMESABASEOBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original
new file mode 100644
index 000000000..463812236
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original
@@ -0,0 +1,61 @@
+XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+/* Large PIC tables needed for Solaris/SPARC builds */
+#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/main/Imakefile.inc"
+#endif
+
+ SRCS = $(COREMESABASESRCS)
+ OBJS = $(COREMESABASEOBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile
new file mode 100644
index 000000000..e21afd5e5
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile
new file mode 100644
index 000000000..49720974c
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile
@@ -0,0 +1,55 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaMathBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/math/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/math/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_MATH_SRCS)
+ OBJS = $(MESA_MATH_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/math \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile
new file mode 100644
index 000000000..e21afd5e5
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile
new file mode 100644
index 000000000..7b14ab7b9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile
@@ -0,0 +1,59 @@
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#define IHaveSubdirs
+ SUBDIRS = grammar slang
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaShaderBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/shader/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/shader/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_SHADER_SRCS)
+ OBJS = $(MESA_SHADER_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/shader/grammar \
+ -I$(MESASRCDIR)/src/mesa/shader/slang \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile
new file mode 100644
index 000000000..c16b3ddad
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile
@@ -0,0 +1,54 @@
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaGrammarBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc"
+#else
+#include "../../../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_GRAMMAR_SRCS)
+ OBJS = $(MESA_GRAMMAR_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/shader/grammar \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile
new file mode 100644
index 000000000..0bee2b774
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile
@@ -0,0 +1,59 @@
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#define IHaveSubdirs
+ SUBDIRS = library
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaSlangBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../../lib/GL/mesa/shader/slang/Imakefile.inc"
+#else
+#include "../../../../../../../lib/GL/mesa/shader/slang/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_SLANG_SRCS)
+ OBJS = $(MESA_SLANG_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/shader/grammar \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile
new file mode 100644
index 000000000..e332121c9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile
@@ -0,0 +1,46 @@
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaLibraryBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../../../lib/GL/mesa/shader/slang/library/Imakefile.inc"
+#else
+#include "../../../../../../../../lib/GL/mesa/shader/slang/library/Imakefile.inc"
+#endif
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/shader/grammar \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile
new file mode 100644
index 000000000..817fead69
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile
@@ -0,0 +1,63 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+/* Large PIC tables needed for Solaris/SPARC builds */
+#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaSwrastBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/swrast/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/swrast/Imakefile.inc"
+#endif
+
+
+ SRCS = $(MESA_SWRAST_SRCS)
+ OBJS = $(MESA_SWRAST_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/swrast \
+ -I$(MESASRCDIR)/src/mesa/swrast_setup \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile
new file mode 100644
index 000000000..7d9974ed0
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile
new file mode 100644
index 000000000..b530457e9
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile
@@ -0,0 +1,55 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast_setup/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaSwrastSetupBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc"
+#endif
+
+ SRCS = $(MESA_SWR_SETUP_SRCS)
+ OBJS = $(MESA_SWR_SETUP_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/swrast_setup \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile
new file mode 100644
index 000000000..5221debc0
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast_setup/module/Imakefile,v 1.1 2002/05/31 18:12:41 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile
new file mode 100644
index 000000000..c52696e4f
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile
@@ -0,0 +1,66 @@
+XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/tnl/Imakefile,v 1.2 2004/08/19 07:34:44 kem Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/tnl/Imakefile,v 1.8 2002/11/22 22:56:02 tsi Exp $
+
+#if DoLoadableServer
+#if !BuildModuleInSubdir
+#define IHaveModules
+#elif !defined(IHaveModules)
+#define IHaveSubdirs
+SUBDIRS = module
+#endif
+#endif
+
+/* Large PIC tables needed for Solaris/SPARC builds */
+#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
+ PICFLAGS = LargePositionIndependentCFlags
+#endif
+
+
+#include <Server.tmpl>
+
+#define NeedAllMesaSrc
+#define NeedToLinkMesaSrc
+#define MesaTnlBuildDir /**/
+#if !defined(IHaveModules) || !BuildModuleInSubdir
+#include "../../../../../lib/GL/mesa/tnl/Imakefile.inc"
+#else
+#include "../../../../../../lib/GL/mesa/tnl/Imakefile.inc"
+#endif
+
+
+ SRCS = $(MESA_TNL_SRCS)
+ OBJS = $(MESA_TNL_OBJS)
+
+ INCLUDES = -I$(MESASRCDIR)/src/mesa \
+ -I$(MESASRCDIR)/src/mesa/array_cache \
+ -I$(MESASRCDIR)/src/mesa/math \
+ -I$(MESASRCDIR)/src/mesa/main \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ -I$(MESASRCDIR)/src/mesa/shader \
+ -I$(MESASRCDIR)/src/mesa/tnl \
+ -I$(MESASRCDIR)/include \
+ -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(XF86SRC) -I$(INCLUDESRC)
+
+ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
+
+#ifdef IHaveModules
+ModuleObjectRule()
+#else
+NormalLibraryObjectRule()
+#endif
+
+SubdirLibraryRule($(OBJS))
+
+LintLibraryTarget(dri,$(SRCS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
+
+#ifdef IHaveSubdirs
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile
new file mode 100644
index 000000000..5d2a4489d
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile
@@ -0,0 +1,6 @@
+XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/tnl/module/Imakefile,v 1.1 2002/05/31 18:12:42 dawes Exp $
+
+#define IHaveModules
+
+#include "../Imakefile"
+
diff --git a/nx-X11/programs/Xserver/GL/opengl/Imakefile b/nx-X11/programs/Xserver/GL/opengl/Imakefile
new file mode 100644
index 000000000..420405d9c
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/opengl/Imakefile
@@ -0,0 +1,140 @@
+XCOMM $XFree86$
+
+XCOMM The contents of this file are subject to the GLX Public License Version 1.0
+XCOMM (the "License"). You may not use this file except in compliance with the
+XCOMM License. You may obtain a copy of the License at Silicon Graphics, Inc.,
+XCOMM attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
+XCOMM or at http://www.sgi.com/software/opensource/glx/license.html.
+XCOMM
+XCOMM Software distributed under the License is distributed on an "AS IS"
+XCOMM basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
+XCOMM IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
+XCOMM PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
+XCOMM language governing rights and limitations under the License.
+XCOMM
+XCOMM The Original Software is GLX version 1.2 source code, released February,
+XCOMM 1999. The developer of the Original Software is Silicon Graphics, Inc.
+XCOMM Those portions of the Subject Software created by Silicon Graphics, Inc.
+XCOMM are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
+
+#include <Library.tmpl>
+
+OBJS = \
+ ddxci.o \
+ ddxcx.o \
+ ddxrgb.o \
+ ddxscreens.o \
+ dl_block.o \
+ dl_heap.o \
+ dl_init.o \
+ dl_list.o \
+ dl_mopt.o \
+ dl_opt.o \
+ dl_pplst.o \
+ dl_splc.o \
+ dl_splst.o \
+ dl_table.o \
+ g_api.o \
+ g_disp.o \
+ g_lcmpex.o \
+ g_lcomp.o \
+ g_lexec.o \
+ g_ltab.o \
+ g_noptab.o \
+ g_splcmp.o \
+ px_api.o \
+ px_mod.o \
+ px_pack.o \
+ px_paths.o \
+ px_read.o \
+ px_rend.o \
+ px_upack.o \
+ s_accum.o \
+ s_atest.o \
+ s_attrib.o \
+ s_bitmap.o \
+ s_blend.o \
+ s_btdraw.o \
+ s_buffer.o \
+ s_capi.o \
+ s_ci.o \
+ s_clear.o \
+ s_clip.o \
+ s_contxt.o \
+ s_cpydsp.o \
+ s_ctable.o \
+ s_depth.o \
+ s_dlist.o \
+ s_eval.o \
+ s_export.o \
+ s_feed.o \
+ s_finish.o \
+ s_fog.o \
+ s_get.o \
+ s_global.o \
+ s_image.o \
+ s_lcache.o \
+ s_lcomp.o \
+ s_light.o \
+ s_lnclip.o \
+ s_lndraw.o \
+ s_lnfast.o \
+ s_lnfin.o \
+ s_lnspan.o \
+ s_math.o \
+ s_memmgr.o \
+ s_names.o \
+ s_napi.o \
+ s_pgaa.o \
+ s_pgclip.o \
+ s_pgdraw.o \
+ s_pgfin.o \
+ s_pgmode.o \
+ s_pgspan.o \
+ s_pick.o \
+ s_prim.o \
+ s_ptaa.o \
+ s_ptdraw.o \
+ s_ptfin.o \
+ s_rapi.o \
+ s_rect.o \
+ s_rgb.o \
+ s_rpos.o \
+ s_select.o \
+ s_size.o \
+ s_span.o \
+ s_sten.o \
+ s_store.o \
+ s_tapi.o \
+ s_tex.o \
+ s_texel.o \
+ s_texmgr.o \
+ s_trap.o \
+ s_vapi.o \
+ s_varray.o \
+ s_vertex.o \
+ s_xform.o \
+ s_zfuncs.o \
+ vc_cache.o \
+ vc_line.o \
+ vc_point.o \
+ vc_poly.o
+
+INCLUDES = \
+ -I. \
+ -I.. \
+ -Iinclude \
+ -I$(TOP)/server/include \
+ -I$(TOP)/programs/Xserver/include \
+ -I$(TOP)/include \
+ -I$(TOP)/include/GL \
+ -I$(INCLUDESRC)
+
+DEFINES = \
+ -D_LANGUAGE_C \
+ -Dunix
+
+NormalLibraryTarget(GL, $(OBJS))
+NormalLibraryObjectRule()
+
+DependTarget()
diff --git a/nx-X11/programs/Xserver/GL/windows/ChangeLog b/nx-X11/programs/Xserver/GL/windows/ChangeLog
new file mode 100644
index 000000000..43a817d6a
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/windows/ChangeLog
@@ -0,0 +1,64 @@
+2005-09-27 Ian Romanick <idr@us.ibm.com>
+
+ * indirect.c:
+ Remove __glEvalComputeK. It is no longer used.
+
+
+2005-04-09 Alexander Gottwald <ago at freedesktop dot org>
+
+ * indirect.c:
+ Fix passing of non-RGB visuals. The old code did not initialize the
+ structure properly which lead to a crash in 8bpp mode
+
+2005-03-01 Alexander Gottwald <ago at freedesktop dot org>
+
+ * indirect.c:
+ * glwindows.h:
+ If a context is already attached copy it instead of reattaching to keep
+ displaylists and share displaylists
+ Enable tracing of often called functions with GLWIN_ENABLE_TRACE
+ ForceCurrent is a no-op now
+
+2005-02-02 Alexander Gottwald <ago at freedesktop dot org>
+
+ * Imakefile:
+ Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866)
+ attachment #1819 (https://bugs.freedesktop.org/attachment.cgi?id=1819):
+ Define APIENTRY on windows to prevent <GL/gl.h> from loading <windows.h>
+
+2005-02-02 Alexander Gottwald <ago at freedesktop dot org>
+
+ * glwrap.c:
+ * glwindows.h:
+ Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866)
+ attachment #1818 (https://bugs.freedesktop.org/attachment.cgi?id=1818):
+ Include Xwindows.h before GL/gl.h to prevent loading windows.h which
+ pollutes our namespace with some symbols.
+
+2005-01-27 Alexander Gottwald <ago at freedesktop dot org>
+
+ * glwrap.c:
+ Functions like glGenTextures and glBindTexture are in OpenGL 1.1
+ and can be resolved at linktime.
+
+2004-11-15 Alexander Gottwald <ago at freedesktop dot org>
+
+ * indirect.c:
+ Bugzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802
+ Added mingw (Win32) port
+
+2004-08-13 Alexander Gottwald <ago@freedesktop.org>
+
+ * Imakefile: Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES.
+ Removed $(SERVERSRC)/mi from INCLUDES.
+ Rearranged INCLUDES for better readability.
+ * glwindows.h: Removed mipointrst.h and miscstruct.h from #include
+ since they are not used anymore.
+
+2004-05-27 Alexander Gottwald <ago@freedesktop.org>
+
+ * glwindows.h: write current function and line in debug output
+ * indirect.c: moved actual setup and creation of windows GL context to
+ glWinCreateContextReal.
+ * indirect.c (glWinCreateContext): Deferred context creation to attach.
+ * indirect.c (glWinMakeCurrent): Check if context is NULL. Fixes segfault.
diff --git a/nx-X11/programs/Xserver/GL/windows/Imakefile b/nx-X11/programs/Xserver/GL/windows/Imakefile
new file mode 100755
index 000000000..2b3ddeb12
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/windows/Imakefile
@@ -0,0 +1,36 @@
+#include <Server.tmpl>
+
+LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
+
+ SRCS = compsize.c indirect.c glwrap.c
+ OBJS = compsize.o indirect.o glwrap.o
+
+ INCLUDES = -I. \
+ -I$(INCLUDESRC) \
+ -I$(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
+ -I$(SERVERSRC)/include \
+ -I$(SERVERSRC)/render \
+ -I$(SERVERSRC)/hw/xwin \
+ -I$(SERVERSRC)/GL/include \
+ -I$(SERVERSRC)/GL/glx \
+ -I$(LIBSRC)/GL/glx \
+ -I$(LIBSRC)/GL/include \
+ -I$(MESASRCDIR)/include \
+ -I$(MESASRCDIR)/src \
+ -I$(MESASRCDIR)/src/mesa/glapi \
+ $(GL_INCLUDES)
+
+#if defined(GlxUseWindows) && GlxUseWindows
+ CYGWIN_GL_DEFINES = -DUSE_OPENGL32
+#endif
+#if defined(Win32Architecture)
+# undef __stdcall
+ APIENTRY_DEFS = -DAPIENTRY=__stdcall
+#endif
+ DEFINES = $(GLX_DEFINES) $(CYGWIN_GL_DEFINES) $(APIENTRY_DEFS)
+
+NormalLibraryTarget(GLcore,$(OBJS))
+NormalLibraryObjectRule()
+
+DependTarget()
diff --git a/nx-X11/programs/Xserver/GL/windows/glwindows.h b/nx-X11/programs/Xserver/GL/windows/glwindows.h
new file mode 100644
index 000000000..74e81f24f
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/windows/glwindows.h
@@ -0,0 +1,64 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/Xwindows.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
+
+#include <glxserver.h>
+#include <glxext.h>
+
+#include <windowstr.h>
+#include <resource.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include <glxscreens.h>
+#include <GL/internal/glcore.h>
+#include <stdlib.h>
+
+
+typedef struct {
+ unsigned enableDebug : 1;
+ unsigned enableTrace : 1;
+ unsigned dumpPFD : 1;
+ unsigned dumpHWND : 1;
+ unsigned dumpDC : 1;
+} glWinDebugSettingsRec, *glWinDebugSettingsPtr;
+extern glWinDebugSettingsRec glWinDebugSettings;
+
+typedef struct {
+ int num_vis;
+ __GLcontextModes *modes;
+ void **priv;
+
+ /* wrapped screen functions */
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ CopyWindowProcPtr CopyWindow;
+} glWinScreenRec;
+
+extern glWinScreenRec glWinScreens[MAXSCREENS];
+
+#define glWinGetScreenPriv(pScreen) &glWinScreens[pScreen->myNum]
+#define glWinScreenPriv(pScreen) glWinScreenRec *pScreenPriv = glWinGetScreenPriv(pScreen);
+
+#if 1
+#define GLWIN_TRACE() if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: Trace\n", __FUNCTION__, __LINE__ )
+#define GLWIN_TRACE_MSG(msg, args...) if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args )
+#define GLWIN_DEBUG_MSG(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args )
+#define GLWIN_DEBUG_MSG2(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF(msg, ##args )
+#else
+#define GLWIN_TRACE()
+#define GLWIN_TRACE_MSG(a, ...)
+#define GLWIN_DEBUG_MSG(a, ...)
+#define GLWIN_DEBUG_MSG2(a, ...)
+#endif
+
diff --git a/nx-X11/programs/Xserver/GL/windows/glwrap.c b/nx-X11/programs/Xserver/GL/windows/glwrap.c
new file mode 100755
index 000000000..f0b38b228
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/windows/glwrap.c
@@ -0,0 +1,583 @@
+/*
+ * GLX implementation that uses Win32's OpenGL
+ * Wrapper functions for Win32's OpenGL
+ *
+ * Authors: Alexander Gottwald
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/Xwindows.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <glxserver.h>
+#include <glxext.h>
+
+#define RESOLVE_RET(procname, symbol, retval) \
+ static Bool init = TRUE; \
+ static procname proc = NULL; \
+ if (init) { \
+ proc = (procname)wglGetProcAddress(symbol); \
+ init = FALSE; \
+ if (proc == NULL) { \
+ ErrorF("glwrap: Can't resolve \"%s\"\n", symbol); \
+ } else \
+ ErrorF("glwrap: resolved \"%s\"\n", symbol); \
+ } \
+ if (proc == NULL) { \
+ __glXErrorCallBack(NULL, 0); \
+ return retval; \
+ }
+#define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,)
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table )
+{
+ RESOLVE(PFNGLCOLORTABLEPROC, "glColorTable");
+ proc(target, internalformat, width, format, type, table);
+}
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data )
+{
+ RESOLVE(PFNGLCOLORSUBTABLEPROC, "glColorSubTable");
+ proc(target, start, count, format, type, data);
+}
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params)
+{
+ RESOLVE(PFNGLCOLORTABLEPARAMETERIVPROC, "glColorTableParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params)
+{
+ RESOLVE(PFNGLCOLORTABLEPARAMETERFVPROC, "glColorTableParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width )
+{
+ RESOLVE(PFNGLCOPYCOLORSUBTABLEPROC, "glCopyColorSubTable");
+ proc(target, start, x, y, width);
+}
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width )
+{
+ RESOLVE(PFNGLCOPYCOLORTABLEPROC, "glCopyColorTable");
+ proc(target, internalformat, x, y, width);
+}
+
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table )
+{
+ RESOLVE(PFNGLGETCOLORTABLEPROC, "glGetColorTable");
+ proc(target, format, type, table);
+}
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params )
+{
+ RESOLVE(PFNGLGETCOLORTABLEPARAMETERFVPROC, "glGetColorTableParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params )
+{
+ RESOLVE(PFNGLGETCOLORTABLEPARAMETERIVPROC, "glGetColorTableParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode )
+{
+ RESOLVE(PFNGLBLENDEQUATIONPROC, "glBlendEquation");
+ proc(mode);
+}
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha )
+{
+ RESOLVE(PFNGLBLENDCOLORPROC, "glBlendColor");
+ proc(red, green, blue, alpha);
+}
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink )
+{
+ RESOLVE(PFNGLHISTOGRAMPROC, "glHistogram");
+ proc(target, width, internalformat, sink);
+}
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target )
+{
+ RESOLVE(PFNGLRESETHISTOGRAMPROC, "glResetHistogram");
+ proc(target);
+}
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values )
+{
+ RESOLVE(PFNGLGETHISTOGRAMPROC, "glGetHistogram");
+ proc(target, reset, format, type, values);
+};
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params )
+{
+ RESOLVE(PFNGLGETHISTOGRAMPARAMETERFVPROC, "glGetHistogramParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params )
+{
+ RESOLVE(PFNGLGETHISTOGRAMPARAMETERIVPROC, "glGetHistogramParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink )
+{
+ RESOLVE(PFNGLMINMAXPROC, "glMinmax");
+ proc(target, internalformat, sink);
+}
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target )
+{
+ RESOLVE(PFNGLRESETMINMAXPROC, "glResetMinmax");
+ proc(target);
+}
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values )
+{
+ RESOLVE(PFNGLGETMINMAXPROC, "glGetMinmax");
+ proc(target, reset, format, types, values);
+}
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params )
+{
+ RESOLVE(PFNGLGETMINMAXPARAMETERFVPROC, "glGetMinmaxParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params )
+{
+ RESOLVE(PFNGLGETMINMAXPARAMETERIVPROC, "glGetMinmaxParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image )
+{
+ RESOLVE(PFNGLCONVOLUTIONFILTER1DPROC, "glConvolutionFilter1D");
+ proc(target, internalformat, width, format, type, image);
+}
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image )
+{
+ RESOLVE(PFNGLCONVOLUTIONFILTER2DPROC, "glConvolutionFilter2D");
+ proc(target, internalformat, width, height, format, type, image);
+}
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params )
+{
+ RESOLVE(PFNGLCONVOLUTIONPARAMETERFPROC, "glConvolutionParameterf");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params )
+{
+ RESOLVE(PFNGLCONVOLUTIONPARAMETERFVPROC, "glConvolutionParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params )
+{
+ RESOLVE(PFNGLCONVOLUTIONPARAMETERIPROC, "glConvolutionParameteri");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params )
+{
+ RESOLVE(PFNGLCONVOLUTIONPARAMETERIVPROC, "glConvolutionParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width )
+{
+ RESOLVE(PFNGLCOPYCONVOLUTIONFILTER1DPROC, "glCopyConvolutionFilter1D");
+ proc(target, internalformat, x, y, width);
+}
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height)
+{
+ RESOLVE(PFNGLCOPYCONVOLUTIONFILTER2DPROC, "glCopyConvolutionFilter2D");
+ proc(target, internalformat, x, y, width, height);
+}
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image )
+{
+ RESOLVE(PFNGLGETCONVOLUTIONFILTERPROC, "glGetConvolutionFilter");
+ proc(target, format, type, image);
+}
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params )
+{
+ RESOLVE(PFNGLGETCONVOLUTIONPARAMETERFVPROC, "glGetConvolutionParameterfv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params )
+{
+ RESOLVE(PFNGLGETCONVOLUTIONPARAMETERIVPROC, "glGetConvolutionParameteriv");
+ proc(target, pname, params);
+}
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column )
+{
+ RESOLVE(PFNGLSEPARABLEFILTER2DPROC, "glSeparableFilter2D");
+ proc(target, internalformat, width, height, format, type, row, column);
+}
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span )
+{
+ RESOLVE(PFNGLGETSEPARABLEFILTERPROC, "glGetSeparableFilter");
+ proc(target, format, type, row, column, span);
+}
+
+/*
+ * OpenGL 1.2
+ */
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ RESOLVE(PFNGLTEXIMAGE3DPROC, "glTexImage3D");
+ proc(target, level, internalFormat, width, height, depth, border, format, type, pixels);
+}
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels)
+{
+ RESOLVE(PFNGLTEXSUBIMAGE3DPROC, "glTexSubImage3D");
+ proc(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height )
+{
+ RESOLVE(PFNGLCOPYTEXSUBIMAGE3DPROC, "glCopyTexSubImage3D");
+ proc(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+
+/*
+ * 20. GL_EXT_texture_object
+ */
+GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures )
+{
+ glGenTextures(n, textures);
+}
+
+GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures)
+{
+ glDeleteTextures(n, textures);
+}
+
+GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture )
+{
+ glBindTexture(target, target);
+}
+
+GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities )
+{
+ glPrioritizeTextures(n, textures, priorities);
+}
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences )
+{
+ return glAreTexturesResident(n, textures, residences);
+}
+
+GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture )
+{
+ return glIsTexture(texture);
+}
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture)
+{
+ RESOLVE(PFNGLACTIVETEXTUREARBPROC, "glActiveTextureARB");
+ proc(texture);
+}
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1DVARBPROC, "glMultiTexCoord1dvARB");
+ proc(target, v);
+}
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1FVARBPROC, "glMultiTexCoord1fvARB");
+ proc(target, v);
+}
+
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1IVARBPROC, "glMultiTexCoord1ivARB");
+ proc(target, v);
+}
+
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD2DVARBPROC, "glMultiTexCoord2dvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD2FVARBPROC, "glMultiTexCoord2fvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD2IVARBPROC, "glMultiTexCoord2ivARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD3DVARBPROC, "glMultiTexCoord3dvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD3FVARBPROC, "glMultiTexCoord3fvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD3IVARBPROC, "glMultiTexCoord3ivARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD4DVARBPROC, "glMultiTexCoord4dvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD4FVARBPROC, "glMultiTexCoord4fvARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD4IVARBPROC, "glMultiTexCoord4ivARB");
+ proc(target, v);
+}
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v)
+{
+ RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB");
+ proc(target, v);
+}
+
+
+GLAPI void GLAPIENTRY glActiveStencilFaceEXT(GLenum face)
+{
+ RESOLVE(PFNGLACTIVESTENCILFACEEXTPROC, "glActiveStencilFaceEXT");
+ proc(face);
+}
+
+GLAPI void APIENTRY glPointParameterfARB(GLenum pname, GLfloat param)
+{
+ RESOLVE(PFNGLPOINTPARAMETERFARBPROC, "glPointParameterfARB");
+ proc(pname, param);
+}
+
+GLAPI void APIENTRY glPointParameterfvARB(GLenum pname, const GLfloat *params)
+{
+ RESOLVE(PFNGLPOINTPARAMETERFVARBPROC, "glPointParameterfvARB");
+ proc(pname, params);
+}
+
+
+GLAPI void APIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z)
+{
+ RESOLVE(PFNGLWINDOWPOS3FARBPROC, "glWindowPos3fARB");
+ proc(x, y, z);
+}
+
+GLAPI void APIENTRY glPointParameteri(GLenum pname, GLint param)
+{
+ RESOLVE(PFNGLPOINTPARAMETERIPROC, "glPointParameteri");
+ proc(pname, param);
+}
+
+GLAPI void APIENTRY glPointParameteriv(GLenum pname, const GLint *params)
+{
+ RESOLVE(PFNGLPOINTPARAMETERIVPROC, "glPointParameteriv");
+ proc(pname, params);
+}
+
+GLAPI void APIENTRY glPointParameteriNV(GLenum pname, GLint param)
+{
+ RESOLVE(PFNGLPOINTPARAMETERINVPROC, "glPointParameteriNV");
+ proc(pname, param);
+}
+
+GLAPI void APIENTRY glPointParameterivNV(GLenum pname, const GLint *params)
+{
+ RESOLVE(PFNGLPOINTPARAMETERIVNVPROC, "glPointParameterivNV");
+ proc(pname, params);
+}
+
+GLAPI void APIENTRY glSecondaryColor3bv(const GLbyte *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3BVPROC, "glSecondaryColor3bv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3dv(const GLdouble *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3DVPROC, "glSecondaryColor3dv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3fv(const GLfloat *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3FVPROC, "glSecondaryColor3fv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3iv(const GLint *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3IVPROC, "glSecondaryColor3iv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3sv(const GLshort *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3SVPROC, "glSecondaryColor3sv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3ubv(const GLubyte *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3UBVPROC, "glSecondaryColor3ubv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3uiv(const GLuint *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3UIVPROC, "glSecondaryColor3uiv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColor3usv(const GLushort *v)
+{
+ RESOLVE(PFNGLSECONDARYCOLOR3USVPROC, "glSecondaryColor3usv");
+ proc(v);
+}
+GLAPI void APIENTRY glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ RESOLVE(PFNGLSECONDARYCOLORPOINTERPROC, "glSecondaryColorPointer");
+ proc(size, type, stride, pointer);
+}
+
+
+GLAPI void APIENTRY glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ RESOLVE(PFNGLBLENDFUNCSEPARATEPROC, "glBlendFuncSeparate");
+ proc(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+}
+GLAPI void APIENTRY glFogCoordfv(const GLfloat *coord)
+{
+ RESOLVE(PFNGLFOGCOORDFVPROC, "glFogCoordfv");
+ proc(coord);
+}
+GLAPI void APIENTRY glFogCoorddv(const GLdouble *coord)
+{
+ RESOLVE(PFNGLFOGCOORDDVPROC, "glFogCoorddv");
+ proc(coord);
+}
+GLAPI void APIENTRY glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ RESOLVE(PFNGLFOGCOORDPOINTERPROC, "glFogCoordPointer");
+ proc(type, stride, pointer);
+}
+
+
+GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert)
+{
+ RESOLVE(PFNGLSAMPLECOVERAGEARBPROC, "glSampleCoverageARB");
+ proc(value, invert);
+}
+GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert)
+{
+ RESOLVE(PFNGLSAMPLEMASKSGISPROC, "glSampleMaskSGIS");
+ proc(value, invert);
+}
+GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern)
+{
+ RESOLVE(PFNGLSAMPLEPATTERNSGISPROC, "glSamplePatternSGIS");
+ proc(pattern);
+}
diff --git a/nx-X11/programs/Xserver/GL/windows/indirect.c b/nx-X11/programs/Xserver/GL/windows/indirect.c
new file mode 100755
index 000000000..5e12022f4
--- /dev/null
+++ b/nx-X11/programs/Xserver/GL/windows/indirect.c
@@ -0,0 +1,1605 @@
+/*
+ * GLX implementation that uses Windows OpenGL library
+ * (Indirect rendering path)
+ *
+ * Authors: Alexander Gottwald
+ */
+/*
+ * Portions of this file are copied from GL/apple/indirect.c,
+ * which contains the following copyright:
+ *
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ * Copyright (c) 2002 Apple Computer, Inc.
+ *
+ * Portions of this file are copied from xf86glx.c,
+ * which contains the following copyright:
+ *
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glwindows.h"
+#include <glcontextmodes.h>
+#include <stdint.h>
+
+#include <winpriv.h>
+
+#define GLWIN_DEBUG_HWND(hwnd) \
+ if (glWinDebugSettings.dumpHWND) { \
+ char buffer[1024]; \
+ if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0; \
+ GLWIN_DEBUG_MSG("Got HWND %s (%p)\n", buffer, hwnd); \
+ }
+
+
+/* ggs: needed to call back to glx with visual configs */
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
+
+glWinDebugSettingsRec glWinDebugSettings = { 1, 0, 0, 0, 0};
+
+static void glWinInitDebugSettings(void)
+{
+ char *envptr;
+
+ envptr = getenv("GLWIN_ENABLE_DEBUG");
+ if (envptr != NULL)
+ glWinDebugSettings.enableDebug = (atoi(envptr) == 1);
+
+ envptr = getenv("GLWIN_ENABLE_TRACE");
+ if (envptr != NULL)
+ glWinDebugSettings.enableTrace = (atoi(envptr) == 1);
+
+ envptr = getenv("GLWIN_DUMP_PFD");
+ if (envptr != NULL)
+ glWinDebugSettings.dumpPFD = (atoi(envptr) == 1);
+
+ envptr = getenv("GLWIN_DUMP_HWND");
+ if (envptr != NULL)
+ glWinDebugSettings.dumpHWND = (atoi(envptr) == 1);
+
+ envptr = getenv("GLWIN_DUMP_DC");
+ if (envptr != NULL)
+ glWinDebugSettings.dumpDC = (atoi(envptr) == 1);
+}
+
+static char errorbuffer[1024];
+const char *glWinErrorMessage(void)
+{
+ if (!FormatMessage(
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &errorbuffer,
+ sizeof(errorbuffer),
+ NULL ))
+ {
+ snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error in FormatMessage: %08x!\n", (unsigned)GetLastError());
+ }
+ return errorbuffer;
+}
+
+/*
+ * GLX implementation that uses Win32's OpenGL
+ */
+
+/*
+ * Server-side GLX uses these functions which are normally defined
+ * in the OpenGL SI.
+ */
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
+
+/* some prototypes */
+static Bool glWinScreenProbe(int screen);
+static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB);
+static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates);
+static __GLinterface *glWinCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC);
+static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv);
+static void glWinResetExtension(void);
+
+/*
+ * This structure is statically allocated in the __glXScreens[]
+ * structure. This struct is not used anywhere other than in
+ * __glXScreenInit to initialize each of the active screens
+ * (__glXActiveScreens[]). Several of the fields must be initialized by
+ * the screenProbe routine before they are copied to the active screens
+ * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
+ * and numUsableVisuals fields must be initialized.
+ */
+static __GLXscreenInfo __glDDXScreenInfo = {
+ glWinScreenProbe, /* Must be generic and handle all screens */
+ glWinCreateContext, /* Substitute screen's createContext routine */
+ glWinCreateBuffer, /* Substitute screen's createBuffer routine */
+ NULL, /* Set up pGlxVisual in probe */
+ NULL, /* Set up pVisualPriv in probe */
+ 0, /* Set up numVisuals in probe */
+ 0, /* Set up numUsableVisuals in probe */
+ "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
+ "Version String", /* GLXversion is overwritten by __glXScreenInit */
+ "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
+ NULL /* WrappedPositionWindow is overwritten */
+};
+
+void *__glXglDDXScreenInfo(void) {
+ return &__glDDXScreenInfo;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_WINDOWS,
+ glWinResetExtension,
+ glWinInitVisuals,
+ glWinSetVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ return &__glDDXExtensionInfo;
+}
+
+/* prototypes */
+
+static GLboolean glWinDestroyContext(__GLcontext *gc);
+static GLboolean glWinLoseCurrent(__GLcontext *gc);
+static GLboolean glWinMakeCurrent(__GLcontext *gc);
+static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare);
+static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask);
+static GLboolean glWinForceCurrent(__GLcontext *gc);
+
+/* Drawing surface notification callbacks */
+static GLboolean glWinNotifyResize(__GLcontext *gc);
+static void glWinNotifyDestroy(__GLcontext *gc);
+static void glWinNotifySwapBuffers(__GLcontext *gc);
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc);
+static void glWinBeginDispatchOverride(__GLcontext *gc);
+static void glWinEndDispatchOverride(__GLcontext *gc);
+
+/* Debug output */
+static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd);
+
+static __GLexports glWinExports = {
+ glWinDestroyContext,
+ glWinLoseCurrent,
+ glWinMakeCurrent,
+ glWinShareContext,
+ glWinCopyContext,
+ glWinForceCurrent,
+
+ glWinNotifyResize,
+ glWinNotifyDestroy,
+ glWinNotifySwapBuffers,
+
+ glWinDispatchExec,
+ glWinBeginDispatchOverride,
+ glWinEndDispatchOverride
+};
+
+glWinScreenRec glWinScreens[MAXSCREENS];
+
+/* __GLdrawablePrivate->private */
+typedef struct {
+ DrawablePtr pDraw;
+ /* xp_surface_id sid; */
+} GLWinDrawableRec;
+
+struct __GLcontextRec {
+ struct __GLinterfaceRec interface; /* required to be first */
+
+ HGLRC ctx; /* Windows GL Context */
+
+ HDC dc; /* Windows Device Context */
+ winWindowInfoRec winInfo; /* Window info from XWin */
+
+ PIXELFORMATDESCRIPTOR pfd; /* Pixelformat flags */
+ int pixelFormat; /* Pixelformat index */
+
+ unsigned isAttached :1; /* Flag to track if context is attached */
+};
+
+static HDC glWinMakeDC(__GLcontext *gc)
+{
+ HDC dc;
+
+ /*if (gc->winInfo.hrgn == NULL)
+ {
+ GLWIN_DEBUG_MSG("Creating region from RECT(%ld,%ld,%ld,%ld):",
+ gc->winInfo.rect.left,
+ gc->winInfo.rect.top,
+ gc->winInfo.rect.right,
+ gc->winInfo.rect.bottom);
+ gc->winInfo.hrgn = CreateRectRgnIndirect(&gc->winInfo.rect);
+ GLWIN_DEBUG_MSG2("%p\n", gc->winInfo.hrgn);
+ }*/
+
+ if (glWinDebugSettings.enableTrace)
+ GLWIN_DEBUG_HWND(gc->winInfo.hwnd);
+
+ dc = GetDC(gc->winInfo.hwnd);
+ /*dc = GetDCEx(gc->winInfo.hwnd, gc->winInfo.hrgn,
+ DCX_WINDOW | DCX_NORESETATTRS ); */
+
+ if (dc == NULL)
+ ErrorF("GetDC error: %s\n", glWinErrorMessage());
+ return dc;
+}
+
+static void unattach(__GLcontext *gc)
+{
+ BOOL ret;
+ GLWIN_DEBUG_MSG("unattach (ctx %p)\n", gc->ctx);
+ if (!gc->isAttached)
+ {
+ ErrorF("called unattach on an unattached context\n");
+ return;
+ }
+
+ if (gc->ctx)
+ {
+ ret = wglDeleteContext(gc->ctx);
+ if (!ret)
+ ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage());
+ gc->ctx = NULL;
+ }
+
+ if (gc->winInfo.hrgn)
+ {
+ ret = DeleteObject(gc->winInfo.hrgn);
+ if (!ret)
+ ErrorF("DeleteObject error: %s\n", glWinErrorMessage());
+ gc->winInfo.hrgn = NULL;
+ }
+
+ gc->isAttached = 0;
+}
+
+static BOOL glWinAdjustHWND(__GLcontext *gc, WindowPtr pWin)
+{
+ HDC dc;
+ BOOL ret;
+ HGLRC newctx;
+ HWND oldhwnd;
+
+ GLWIN_DEBUG_MSG("glWinAdjustHWND (ctx %p, pWin %p)\n", gc->ctx, pWin);
+
+ if (pWin == NULL)
+ {
+ GLWIN_DEBUG_MSG("Deferring until window is created\n");
+ return FALSE;
+ }
+
+ oldhwnd = gc->winInfo.hwnd;
+ winGetWindowInfo(pWin, &gc->winInfo);
+
+ GLWIN_DEBUG_HWND(gc->winInfo.hwnd);
+ if (gc->winInfo.hwnd == NULL)
+ {
+ GLWIN_DEBUG_MSG("Deferring until window is created\n");
+ return FALSE;
+ }
+
+ dc = glWinMakeDC(gc);
+
+ if (glWinDebugSettings.dumpDC)
+ GLWIN_DEBUG_MSG("Got HDC %p\n", dc);
+
+ gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd);
+ if (gc->pixelFormat == 0)
+ {
+ ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd);
+ if (!ret) {
+ ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ newctx = wglCreateContext(dc);
+ if (newctx == NULL) {
+ ErrorF("wglCreateContext error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ GLWIN_DEBUG_MSG("wglCreateContext (ctx %p)\n", newctx);
+
+ if (!wglShareLists(gc->ctx, newctx))
+ {
+ ErrorF("wglShareLists error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ if (oldhwnd != gc->winInfo.hwnd)
+ {
+ GLWIN_DEBUG_MSG("Trying wglCopyContext\n");
+ if (!wglCopyContext(gc->ctx, newctx, GL_ALL_ATTRIB_BITS))
+ {
+ ErrorF("wglCopyContext error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+ }
+
+ if (!wglDeleteContext(gc->ctx))
+ {
+ ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage());
+ }
+
+ gc->ctx = newctx;
+
+ if (!wglMakeCurrent(dc, gc->ctx)) {
+ ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ ReleaseDC(gc->winInfo.hwnd, dc);
+
+ return TRUE;
+}
+
+static BOOL glWinCreateContextReal(__GLcontext *gc, WindowPtr pWin)
+{
+ HDC dc;
+ BOOL ret;
+
+ GLWIN_DEBUG_MSG("glWinCreateContextReal (pWin %p)\n", pWin);
+
+ if (pWin == NULL)
+ {
+ GLWIN_DEBUG_MSG("Deferring until window is created\n");
+ return FALSE;
+ }
+
+ winGetWindowInfo(pWin, &gc->winInfo);
+
+ GLWIN_DEBUG_HWND(gc->winInfo.hwnd);
+ if (gc->winInfo.hwnd == NULL)
+ {
+ GLWIN_DEBUG_MSG("Deferring until window is created\n");
+ return FALSE;
+ }
+
+
+ dc = glWinMakeDC(gc);
+
+ if (glWinDebugSettings.dumpDC)
+ GLWIN_DEBUG_MSG("Got HDC %p\n", dc);
+
+ gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd);
+ if (gc->pixelFormat == 0)
+ {
+ ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd);
+ if (!ret) {
+ ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ gc->ctx = wglCreateContext(dc);
+ if (gc->ctx == NULL) {
+ ErrorF("wglCreateContext error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ GLWIN_DEBUG_MSG("glWinCreateContextReal (ctx %p)\n", gc->ctx);
+
+ if (!wglMakeCurrent(dc, gc->ctx)) {
+ ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ return FALSE;
+ }
+
+ ReleaseDC(gc->winInfo.hwnd, dc);
+
+ return TRUE;
+}
+
+static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv)
+{
+ __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
+
+ GLWIN_DEBUG_MSG("attach (ctx %p)\n", gc->ctx);
+
+ if (gc->isAttached)
+ {
+ ErrorF("called attach on an attached context\n");
+ return;
+ }
+
+ if (glxPriv->type == DRAWABLE_WINDOW)
+ {
+ WindowPtr pWin = (WindowPtr) glxPriv->pDraw;
+ if (pWin == NULL)
+ {
+ GLWIN_DEBUG_MSG("Deferring ChoosePixelFormat until window is created\n");
+ } else
+ {
+ if (glWinCreateContextReal(gc, pWin))
+ {
+ gc->isAttached = TRUE;
+ GLWIN_DEBUG_MSG("attached\n");
+ }
+ }
+ }
+}
+
+static GLboolean glWinLoseCurrent(__GLcontext *gc)
+{
+ GLWIN_TRACE_MSG("glWinLoseCurrent (ctx %p)\n", gc->ctx);
+
+ __glXLastContext = NULL; /* Mesa does this; why? */
+
+ return GL_TRUE;
+}
+
+/* Context manipulation; return GL_FALSE on failure */
+static GLboolean glWinDestroyContext(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("glWinDestroyContext (ctx %p)\n", gc->ctx);
+
+ if (gc != NULL)
+ {
+ if (gc->isAttached)
+ unattach(gc);
+ if (gc->dc != NULL)
+ DeleteDC(gc->dc);
+ free(gc);
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean glWinMakeCurrent(__GLcontext *gc)
+{
+ __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
+ BOOL ret;
+ HDC dc;
+
+ GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx);
+
+ if (!gc->isAttached)
+ attach(gc, glPriv);
+
+ if (gc->ctx == NULL) {
+ ErrorF("Context is NULL\n");
+ return GL_FALSE;
+ }
+
+ dc = glWinMakeDC(gc);
+ ret = wglMakeCurrent(dc, gc->ctx);
+ if (!ret)
+ ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage());
+ ReleaseDC(gc->winInfo.hwnd, dc);
+
+ return ret?GL_TRUE:GL_FALSE;
+}
+
+static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ GLWIN_DEBUG_MSG("glWinShareContext unimplemented\n");
+
+ return GL_TRUE;
+}
+
+static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src,
+ GLuint mask)
+{
+ BOOL ret;
+
+ GLWIN_DEBUG_MSG("glWinCopyContext\n");
+
+ ret = wglCopyContext(src->ctx, dst->ctx, mask);
+ if (!ret)
+ {
+ ErrorF("wglCopyContext error: %s\n", glWinErrorMessage());
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean glWinForceCurrent(__GLcontext *gc)
+{
+ GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx);
+
+ return GL_TRUE;
+}
+
+/* Drawing surface notification callbacks */
+
+static GLboolean glWinNotifyResize(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinNotifyResize");
+ return GL_TRUE;
+}
+
+static void glWinNotifyDestroy(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinNotifyDestroy");
+}
+
+static void glWinNotifySwapBuffers(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinNotifySwapBuffers");
+}
+
+/* Dispatch table override control for external agents like libGLS */
+static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinDispatchExec");
+ return NULL;
+}
+
+static void glWinBeginDispatchOverride(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinBeginDispatchOverride");
+}
+
+static void glWinEndDispatchOverride(__GLcontext *gc)
+{
+ GLWIN_DEBUG_MSG("unimplemented glWinEndDispatchOverride");
+}
+
+#define DUMP_PFD_FLAG(flag) \
+ if (pfd->dwFlags & flag) { \
+ ErrorF("%s%s", pipesym, #flag); \
+ pipesym = " | "; \
+ }
+
+static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd)
+{
+ const char *pipesym = ""; /* will be set after first flag dump */
+ ErrorF("PIXELFORMATDESCRIPTOR:\n");
+ ErrorF("nSize = %u\n", pfd->nSize);
+ ErrorF("nVersion = %u\n", pfd->nVersion);
+ ErrorF("dwFlags = %lu = {", pfd->dwFlags);
+ DUMP_PFD_FLAG(PFD_MAIN_PLANE);
+ DUMP_PFD_FLAG(PFD_OVERLAY_PLANE);
+ DUMP_PFD_FLAG(PFD_UNDERLAY_PLANE);
+ DUMP_PFD_FLAG(PFD_DOUBLEBUFFER);
+ DUMP_PFD_FLAG(PFD_STEREO);
+ DUMP_PFD_FLAG(PFD_DRAW_TO_WINDOW);
+ DUMP_PFD_FLAG(PFD_DRAW_TO_BITMAP);
+ DUMP_PFD_FLAG(PFD_SUPPORT_GDI);
+ DUMP_PFD_FLAG(PFD_SUPPORT_OPENGL);
+ DUMP_PFD_FLAG(PFD_GENERIC_FORMAT);
+ DUMP_PFD_FLAG(PFD_NEED_PALETTE);
+ DUMP_PFD_FLAG(PFD_NEED_SYSTEM_PALETTE);
+ DUMP_PFD_FLAG(PFD_SWAP_EXCHANGE);
+ DUMP_PFD_FLAG(PFD_SWAP_COPY);
+ DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS);
+ DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED);
+ DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE);
+ DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE);
+ DUMP_PFD_FLAG(PFD_STEREO_DONTCARE);
+ ErrorF("}\n");
+
+ ErrorF("iPixelType = %hu = %s\n", pfd->iPixelType,
+ (pfd->iPixelType == PFD_TYPE_RGBA ? "PFD_TYPE_RGBA" : "PFD_TYPE_COLORINDEX"));
+ ErrorF("cColorBits = %hhu\n", pfd->cColorBits);
+ ErrorF("cRedBits = %hhu\n", pfd->cRedBits);
+ ErrorF("cRedShift = %hhu\n", pfd->cRedShift);
+ ErrorF("cGreenBits = %hhu\n", pfd->cGreenBits);
+ ErrorF("cGreenShift = %hhu\n", pfd->cGreenShift);
+ ErrorF("cBlueBits = %hhu\n", pfd->cBlueBits);
+ ErrorF("cBlueShift = %hhu\n", pfd->cBlueShift);
+ ErrorF("cAlphaBits = %hhu\n", pfd->cAlphaBits);
+ ErrorF("cAlphaShift = %hhu\n", pfd->cAlphaShift);
+ ErrorF("cAccumBits = %hhu\n", pfd->cAccumBits);
+ ErrorF("cAccumRedBits = %hhu\n", pfd->cAccumRedBits);
+ ErrorF("cAccumGreenBits = %hhu\n", pfd->cAccumGreenBits);
+ ErrorF("cAccumBlueBits = %hhu\n", pfd->cAccumBlueBits);
+ ErrorF("cAccumAlphaBits = %hhu\n", pfd->cAccumAlphaBits);
+ ErrorF("cDepthBits = %hhu\n", pfd->cDepthBits);
+ ErrorF("cStencilBits = %hhu\n", pfd->cStencilBits);
+ ErrorF("cAuxBuffers = %hhu\n", pfd->cAuxBuffers);
+ ErrorF("iLayerType = %hhu\n", pfd->iLayerType);
+ ErrorF("bReserved = %hhu\n", pfd->bReserved);
+ ErrorF("dwLayerMask = %lu\n", pfd->dwLayerMask);
+ ErrorF("dwVisibleMask = %lu\n", pfd->dwVisibleMask);
+ ErrorF("dwDamageMask = %lu\n", pfd->dwDamageMask);
+ ErrorF("\n");
+}
+
+static int makeFormat(__GLcontextModes *mode, PIXELFORMATDESCRIPTOR *pfdret)
+{
+ PIXELFORMATDESCRIPTOR pfd = {
+ sizeof(PIXELFORMATDESCRIPTOR), /* size of this pfd */
+ 1, /* version number */
+ PFD_DRAW_TO_WINDOW | /* support window */
+ PFD_SUPPORT_OPENGL, /* support OpenGL */
+ PFD_TYPE_RGBA, /* RGBA type */
+ 24, /* 24-bit color depth */
+ 0, 0, 0, 0, 0, 0, /* color bits ignored */
+ 0, /* no alpha buffer */
+ 0, /* shift bit ignored */
+ 0, /* no accumulation buffer */
+ 0, 0, 0, 0, /* accum bits ignored */
+ 0, /* 32-bit z-buffer */
+ 0, /* no stencil buffer */
+ 0, /* no auxiliary buffer */
+ PFD_MAIN_PLANE, /* main layer */
+ 0, /* reserved */
+ 0, 0, 0 /* layer masks ignored */
+ }, *result = &pfd;
+
+ /* disable anything but rgba. must get rgba to work first */
+ if (!mode->rgbMode)
+ return -1;
+
+ if (mode->stereoMode) {
+ result->dwFlags |= PFD_STEREO;
+ }
+ if (mode->doubleBufferMode) {
+ result->dwFlags |= PFD_DOUBLEBUFFER;
+ }
+
+ if (mode->colorIndexMode) {
+ /* ignored, see above */
+ result->iPixelType = PFD_TYPE_COLORINDEX;
+ result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits;
+ result->cRedBits = mode->redBits;
+ result->cRedShift = 0; /* FIXME */
+ result->cGreenBits = mode->greenBits;
+ result->cGreenShift = 0; /* FIXME */
+ result->cBlueBits = mode->blueBits;
+ result->cBlueShift = 0; /* FIXME */
+ result->cAlphaBits = mode->alphaBits;
+ result->cAlphaShift = 0; /* FIXME */
+ }
+
+ if (mode->rgbMode) {
+ result->iPixelType = PFD_TYPE_RGBA;
+ result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits;
+ result->cRedBits = mode->redBits;
+ result->cRedShift = 0; /* FIXME */
+ result->cGreenBits = mode->greenBits;
+ result->cGreenShift = 0; /* FIXME */
+ result->cBlueBits = mode->blueBits;
+ result->cBlueShift = 0; /* FIXME */
+ result->cAlphaBits = mode->alphaBits;
+ result->cAlphaShift = 0; /* FIXME */
+ }
+
+ if (mode->haveAccumBuffer) {
+ result->cAccumBits = mode->accumRedBits + mode->accumGreenBits
+ + mode->accumBlueBits + mode->accumAlphaBits;
+ result->cAccumRedBits = mode->accumRedBits;
+ result->cAccumGreenBits = mode->accumGreenBits;
+ result->cAccumBlueBits = mode->accumBlueBits;
+ result->cAccumAlphaBits = mode->accumAlphaBits;
+ }
+
+ if (mode->haveDepthBuffer) {
+ result->cDepthBits = mode->depthBits;
+ }
+ if (mode->haveStencilBuffer) {
+ result->cStencilBits = mode->stencilBits;
+ }
+
+ /* result->cAuxBuffers = mode->numAuxBuffers; */
+
+ /* mode->level ignored */
+
+ /* mode->pixmapMode ? */
+
+ *pfdret = pfd;
+
+ return 0;
+}
+
+static __GLinterface *glWinCreateContext(__GLimports *imports,
+ __GLcontextModes *mode,
+ __GLinterface *shareGC)
+{
+ __GLcontext *result;
+
+ GLWIN_DEBUG_MSG("glWinCreateContext\n");
+
+ result = (__GLcontext *)calloc(1, sizeof(__GLcontext));
+ if (!result)
+ return NULL;
+
+ result->interface.imports = *imports;
+ result->interface.exports = glWinExports;
+
+ if (makeFormat(mode, &result->pfd))
+ {
+ ErrorF("makeFormat failed\n");
+ free(result);
+ return NULL;
+ }
+
+ if (glWinDebugSettings.dumpPFD)
+ pfdOut(&result->pfd);
+
+ GLWIN_DEBUG_MSG("glWinCreateContext done\n");
+ return (__GLinterface *)result;
+}
+
+Bool
+glWinRealizeWindow(WindowPtr pWin)
+{
+ /* If this window has GL contexts, tell them to reattach */
+ /* reattaching is bad: display lists and parameters get lost */
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLWIN_DEBUG_MSG("glWinRealizeWindow\n");
+
+ /* Allow the window to be created (RootlessRealizeWindow is inside our wrap) */
+ pScreen->RealizeWindow = screenPriv->RealizeWindow;
+ result = pScreen->RealizeWindow(pWin);
+ pScreen->RealizeWindow = glWinRealizeWindow;
+
+ /* Re-attach this window's GL contexts, if any. */
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+ GLWIN_DEBUG_MSG("glWinRealizeWindow is GL drawable!\n");
+
+ /* GL contexts bound to this window for drawing */
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ if (gc->isAttached)
+#if 1
+ {
+ GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n");
+ glWinAdjustHWND(gc, pWin);
+ continue;
+ }
+#else
+ unattach(gc);
+#endif
+ attach(gc, glPriv);
+ }
+
+ /* GL contexts bound to this window for reading */
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ if (gc->isAttached)
+#if 1
+ {
+ GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n");
+ glWinAdjustHWND(gc, pWin);
+ continue;
+ }
+#else
+ unattach(gc);
+#endif
+ attach(gc, glPriv);
+ }
+ }
+
+ return result;
+}
+
+
+void
+glWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLWIN_TRACE_MSG(" (pWindow %p)\n", pWindow);
+
+ /* Check if the window is attached and discard any drawing request */
+ glxPriv = __glXFindDrawablePrivate(pWindow->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+
+ /* GL contexts bound to this window for drawing */
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
+/*
+ GLWIN_DEBUG_MSG("glWinCopyWindow - calling glDrawBuffer\n");
+ glDrawBuffer(GL_FRONT);
+ */
+
+ return;
+ }
+
+ /* GL contexts bound to this window for reading */
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
+ return;
+ }
+ }
+
+ GLWIN_DEBUG_MSG("glWinCopyWindow - passing to hw layer\n");
+
+ pScreen->CopyWindow = screenPriv->CopyWindow;
+ pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc);
+ pScreen->CopyWindow = glWinCopyWindow;
+}
+
+Bool
+glWinUnrealizeWindow(WindowPtr pWin)
+{
+ /* If this window has GL contexts, tell them to unattach */
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum];
+ __GLXdrawablePrivate *glxPriv;
+
+ GLWIN_DEBUG_MSG("glWinUnrealizeWindow\n");
+
+ /* The Aqua window may have already been destroyed (windows
+ * are unrealized from top down)
+ */
+
+ /* Unattach this window's GL contexts, if any. */
+ glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
+ if (glxPriv) {
+ __GLXcontext *gx;
+ __GLcontext *gc;
+ GLWIN_DEBUG_MSG("glWinUnealizeWindow is GL drawable!\n");
+
+ /* GL contexts bound to this window for drawing */
+ for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ unattach(gc);
+ }
+
+ /* GL contexts bound to this window for reading */
+ for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
+ gc = (__GLcontext *)gx->gc;
+ unattach(gc);
+ }
+ }
+
+ pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
+ result = pScreen->UnrealizeWindow(pWin);
+ pScreen->UnrealizeWindow = glWinUnrealizeWindow;
+
+ return result;
+}
+
+
+/*
+ * In the case the driver has no GLX visuals we'll use these.
+ * [0] = RGB, double buffered
+ * [1] = RGB, double buffered, stencil, accum
+ */
+/* Originally copied from Mesa */
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+#define NUM_FALLBACK_CONFIGS 2
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ }
+};
+
+static __GLXvisualConfig NullConfig = {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+};
+
+static inline int count_bits(uint32_t x)
+{
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0f0f0f0f;
+ x = x + (x >> 8);
+ x = x + (x >> 16);
+ return x & 63;
+}
+
+/* Mostly copied from Mesa's xf86glx.c */
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes = NULL;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ GLWIN_DEBUG_MSG("init_visuals\n");
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ int count;
+
+ count = ((pVisual[i].class == TrueColor
+ || pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs);
+ if (count == 0)
+ count = 1; /* preserve the existing visual */
+
+ numNewVisuals += count;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ __glXFree(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ glWinScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ if (!is_rgb)
+ {
+ /* We don't support non-rgb visuals for GL. But we don't
+ want to remove them either, so just pass them through
+ with null glX configs */
+
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & NullConfig );
+ modes->visualID = pVisualNew[j].vid;
+
+ j++;
+
+ continue;
+ }
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ glWinScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ glWinScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
+
+ /* Set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ __glXFree(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ __glXFree(pVisual);
+
+ /* Clean up temporary allocations */
+ __glXFree(orig_vid);
+ __glXFree(pNewVisualPriv);
+ __glXFree(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ xfree(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ glWinScreenRec *pScr = &glWinScreens[screen];
+ __GLcontextModes *modes;
+ int j;
+
+ GLWIN_DEBUG_MSG("fixup_visuals\n");
+
+ for (modes = pScr->modes; modes != NULL; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+
+static void init_screen_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ __GLcontextModes *modes;
+ int *used;
+ int i, j;
+
+ GLWIN_DEBUG_MSG("init_screen_visuals\n");
+
+ used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
+ __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = glWinScreens[screen].modes
+ ; modes != NULL
+ ; modes = modes->next) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+#if 0
+ /* Create the XMesa visual */
+ pXMesaVisual[i] =
+ XMesaCreateVisual(pScreen,
+ pVis,
+ modes->rgbMode,
+ (modes->alphaBits > 0),
+ modes->doubleBufferMode,
+ modes->stereoMode,
+ GL_TRUE, /* ximage_flag */
+ modes->depthBits,
+ modes->stencilBits,
+ modes->accumRedBits,
+ modes->accumGreenBits,
+ modes->accumBlueBits,
+ modes->accumAlphaBits,
+ modes->samples,
+ modes->level,
+ modes->visualRating);
+#endif
+
+ /* Set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ modes->visualType,
+ (modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+
+ }
+
+ __glXFree(used);
+
+ /* glWinScreens[screen].xm_vis = pXMesaVisual; */
+}
+
+static Bool glWinScreenProbe(int screen)
+{
+ ScreenPtr pScreen;
+ glWinScreenRec *screenPriv;
+
+ GLWIN_DEBUG_MSG("glWinScreenProbe\n");
+
+ /*
+ * Set up the current screen's visuals.
+ */
+ __glDDXScreenInfo.modes = glWinScreens[screen].modes;
+ __glDDXScreenInfo.pVisualPriv = glWinScreens[screen].priv;
+ __glDDXScreenInfo.numVisuals =
+ __glDDXScreenInfo.numUsableVisuals = glWinScreens[screen].num_vis;
+
+ /*
+ * Set the current screen's createContext routine. This could be
+ * wrapped by a DDX GLX context creation routine.
+ */
+ __glDDXScreenInfo.createContext = glWinCreateContext;
+
+ /*
+ * The ordering of the rgb compenents might have been changed by the
+ * driver after mi initialized them.
+ */
+ fixup_visuals(screen);
+
+ /*
+ * Find the GLX visuals that are supported by this screen and create
+ * XMesa's visuals.
+ */
+ init_screen_visuals(screen);
+
+ /* Wrap RealizeWindow and UnrealizeWindow on this screen */
+ pScreen = screenInfo.screens[screen];
+ screenPriv = &glWinScreens[screen];
+ screenPriv->RealizeWindow = pScreen->RealizeWindow;
+ pScreen->RealizeWindow = glWinRealizeWindow;
+ screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
+ pScreen->UnrealizeWindow = glWinUnrealizeWindow;
+ screenPriv->CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = glWinCopyWindow;
+
+ return TRUE;
+}
+
+static GLboolean glWinSwapBuffers(__GLXdrawablePrivate *glxPriv)
+{
+ /* swap buffers on only *one* of the contexts
+ * (e.g. the last one for drawing)
+ */
+ __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
+ HDC dc;
+ BOOL ret;
+
+ GLWIN_TRACE_MSG("glWinSwapBuffers (ctx %p)\n", (gc!=NULL?gc->ctx:NULL));
+
+ if (gc != NULL && gc->ctx != NULL)
+ {
+ dc = glWinMakeDC(gc);
+ if (dc == NULL)
+ return GL_FALSE;
+
+ ret = SwapBuffers(dc);
+ if (!ret)
+ ErrorF("SwapBuffers failed: %s\n", glWinErrorMessage());
+
+ ReleaseDC(gc->winInfo.hwnd, dc);
+ if (!ret)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static void glWinDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
+{
+ GLWIN_DEBUG_MSG("glWinDestroyDrawablePrivate\n");
+
+ /* It doesn't work to call DRIDestroySurface here, the drawable's
+ already gone.. But dri.c notices the window destruction and
+ frees the surface itself. */
+
+ free(glPriv->private);
+ glPriv->private = NULL;
+}
+
+
+static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv)
+{
+ GLWinDrawableRec *winPriv = malloc(sizeof(GLWinDrawableRec));
+ __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+
+ /*winPriv->sid = 0; */
+ winPriv->pDraw = NULL;
+
+ GLWIN_DEBUG_MSG("glWinCreateBuffer\n");
+
+ /* replace swapBuffers (original is never called) */
+ glxPriv->swapBuffers = glWinSwapBuffers;
+
+ /* stash private data */
+ glPriv->private = winPriv;
+ glPriv->freePrivate = glWinDestroyDrawablePrivate;
+}
+
+static void glWinResetExtension(void)
+{
+ GLWIN_DEBUG_MSG("glWinResetExtension\n");
+}
+
+/* based on code in apples/indirect.c which is based on i830_dri.c */
+static void
+glWinInitVisualConfigs(void)
+{
+ int lclNumConfigs = 0;
+ __GLXvisualConfig *lclVisualConfigs = NULL;
+ void **lclVisualPrivates = NULL;
+
+ int depth, aux, buffers, stencil, accum;
+ int i = 0;
+
+ GLWIN_DEBUG_MSG("glWinInitVisualConfigs ");
+
+ /* count num configs:
+ 2 Z buffer (0, 24 bit)
+ 2 AUX buffer (0, 2)
+ 2 buffers (single, double)
+ 2 stencil (0, 8 bit)
+ 2 accum (0, 64 bit)
+ = 32 configs */
+
+ lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+
+ /* alloc */
+ lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs);
+ lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs);
+
+ /* fill in configs */
+ if (NULL != lclVisualConfigs) {
+ i = 0; /* current buffer */
+ for (depth = 0; depth < 2; depth++) {
+ for (aux = 0; aux < 2; aux++) {
+ for (buffers = 0; buffers < 2; buffers++) {
+ for (stencil = 0; stencil < 2; stencil++) {
+ for (accum = 0; accum < 2; accum++) {
+ lclVisualConfigs[i].vid = -1;
+ lclVisualConfigs[i].class = -1;
+ lclVisualConfigs[i].rgba = TRUE;
+ lclVisualConfigs[i].redSize = -1;
+ lclVisualConfigs[i].greenSize = -1;
+ lclVisualConfigs[i].blueSize = -1;
+ lclVisualConfigs[i].redMask = -1;
+ lclVisualConfigs[i].greenMask = -1;
+ lclVisualConfigs[i].blueMask = -1;
+ lclVisualConfigs[i].alphaMask = 0;
+ if (accum) {
+ lclVisualConfigs[i].accumRedSize = 16;
+ lclVisualConfigs[i].accumGreenSize = 16;
+ lclVisualConfigs[i].accumBlueSize = 16;
+ lclVisualConfigs[i].accumAlphaSize = 16;
+ }
+ else {
+ lclVisualConfigs[i].accumRedSize = 0;
+ lclVisualConfigs[i].accumGreenSize = 0;
+ lclVisualConfigs[i].accumBlueSize = 0;
+ lclVisualConfigs[i].accumAlphaSize = 0;
+ }
+ lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+ lclVisualConfigs[i].stereo = FALSE;
+ lclVisualConfigs[i].bufferSize = -1;
+
+ lclVisualConfigs[i].depthSize = depth? 24 : 0;
+ lclVisualConfigs[i].stencilSize = stencil ? 8 : 0;
+ lclVisualConfigs[i].auxBuffers = aux ? 2 : 0;
+ lclVisualConfigs[i].level = 0;
+ lclVisualConfigs[i].visualRating = GLX_NONE_EXT;
+ lclVisualConfigs[i].transparentPixel = 0;
+ lclVisualConfigs[i].transparentRed = 0;
+ lclVisualConfigs[i].transparentGreen = 0;
+ lclVisualConfigs[i].transparentBlue = 0;
+ lclVisualConfigs[i].transparentAlpha = 0;
+ lclVisualConfigs[i].transparentIndex = 0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (i != lclNumConfigs)
+ GLWIN_DEBUG_MSG("glWinInitVisualConfigs failed to alloc visual configs");
+
+ GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
+}
+
+/* Copied from Mesa */
+static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ GLWIN_DEBUG_MSG("glWinSetVisualConfigs\n");
+
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+/* Copied from Mesa */
+static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB)
+{
+ glWinInitDebugSettings();
+
+ GLWIN_DEBUG_MSG("glWinInitVisuals\n");
+
+ if (0 == numConfigs) /* if no configs */
+ glWinInitVisualConfigs(); /* ensure the visula configs are setup */
+
+ /*
+ * Setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}