1 #ifdef HAVE_DIX_CONFIG_H
2 #include <dix-config.h>
9 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
10 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice including the dates of first publication and
20 * either this permission notice or a reference to
21 * http://oss.sgi.com/projects/FreeB/
22 * shall be included in all copies or substantial portions of the Software.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
29 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * Except as contained in this notice, the name of Silicon Graphics, Inc.
33 * shall not be used in advertising or otherwise to promote the sale, use or
34 * other dealings in this Software without prior written authorization from
35 * Silicon Graphics, Inc.
39 #include <X11/Xproto.h>
42 #include <dixstruct.h>
43 #include <pixmapstr.h>
45 #include <extnsionst.h>
47 #include <scrnintstr.h>
50 ** The X header misc.h defines these math functions.
55 #define GL_GLEXT_PROTOTYPES /* we want prototypes */
57 #include <GL/glxproto.h>
62 typedef XID GLXContextID;
63 typedef XID GLXPixmap;
64 typedef XID GLXDrawable;
66 typedef struct __GLXclientStateRec __GLXclientState;
67 typedef struct __GLXdrawable __GLXdrawable;
68 typedef struct __GLXcontext __GLXcontext;
70 #include "glxscreens.h"
71 #include "glxdrawable.h"
72 #include "glxcontext.h"
81 extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
82 extern __GLXclientState *glxGetClient(ClientPtr pClient);
84 /************************************************************************/
86 void GlxExtensionInit(void);
88 void GlxSetVisualConfigs(int nconfigs,
89 void *configs, void **privates);
91 void __glXScreenInitVisuals(__GLXscreen *screen);
94 ** The last context used (from the server's persective) is cached.
96 extern __GLXcontext *__glXLastContext;
97 extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
99 extern ClientPtr __pGlxClient;
101 int __glXError(int error);
104 ** Macros to set, unset, and retrieve the flag that says whether a context
105 ** has unflushed commands.
107 #define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
108 #define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
109 #define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
111 /************************************************************************/
113 typedef struct __GLXprovider __GLXprovider;
114 struct __GLXprovider {
115 __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
120 void GlxPushProvider(__GLXprovider *provider);
128 void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
129 void (*leave)(GLboolean));
130 void __glXenterServer(GLboolean rendering);
131 void __glXleaveServer(GLboolean rendering);
133 void glxSuspendClients(void);
134 void glxResumeClients(void);
137 ** State kept per client.
139 struct __GLXclientStateRec {
141 ** Whether this structure is currently being used to support a client.
146 ** Buffer for returned data.
152 ** Keep track of large rendering commands, which span multiple requests.
154 GLint largeCmdBytesSoFar; /* bytes received so far */
155 GLint largeCmdBytesTotal; /* total bytes expected */
156 GLint largeCmdRequestsSoFar; /* requests received so far */
157 GLint largeCmdRequestsTotal; /* total requests expected */
159 GLint largeCmdBufSize;
162 ** Keep a list of all the contexts that are current for this client's
165 __GLXcontext **currentContexts;
166 GLint numCurrentContexts;
168 /* Back pointer to X client record */
171 int GLClientmajorVersion;
172 int GLClientminorVersion;
173 char *GLClientextensions;
176 /************************************************************************/
181 typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
182 typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
183 typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
186 * Dispatch for GLX commands.
188 typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
191 * Tables for computing the size of each rendering command.
193 typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
197 gl_proto_size_func varsize;
198 } __GLXrenderSizeData;
200 /************************************************************************/
205 extern RESTYPE __glXContextRes;
206 extern RESTYPE __glXClientRes;
207 extern RESTYPE __glXPixmapRes;
208 extern RESTYPE __glXDrawableRes;
210 /************************************************************************/
216 extern char *__glXcombine_strings(const char *, const char *);
219 ** Routines for sending swapped replies.
222 extern void __glXSwapMakeCurrentReply(ClientPtr client,
223 xGLXMakeCurrentReply *reply);
224 extern void __glXSwapIsDirectReply(ClientPtr client,
225 xGLXIsDirectReply *reply);
226 extern void __glXSwapQueryVersionReply(ClientPtr client,
227 xGLXQueryVersionReply *reply);
228 extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
229 xGLXQueryContextInfoEXTReply *reply,
231 extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
232 xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
233 extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
234 xGLXQueryExtensionsStringReply *reply, char *buf);
235 extern void glxSwapQueryServerStringReply(ClientPtr client,
236 xGLXQueryServerStringReply *reply, char *buf);
240 * Routines for computing the size of variably-sized rendering commands.
243 extern int __glXTypeSize(GLenum enm);
244 extern int __glXImageSize(GLenum format, GLenum type,
245 GLenum target, GLsizei w, GLsizei h, GLsizei d,
246 GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
249 extern unsigned glxMajorVersion;
250 extern unsigned glxMinorVersion;
252 extern int __glXEventBase;
254 #endif /* !__GLX_server_h__ */