1 | #ifdef HAVE_DIX_CONFIG_H
|
---|
2 | #include <dix-config.h>
|
---|
3 | #endif
|
---|
4 |
|
---|
5 | #ifndef _GLX_server_h_
|
---|
6 | #define _GLX_server_h_
|
---|
7 |
|
---|
8 | /*
|
---|
9 | ** License Applicability. Except to the extent portions of this file are
|
---|
10 | ** made subject to an alternative license as permitted in the SGI Free
|
---|
11 | ** Software License B, Version 1.1 (the "License"), the contents of this
|
---|
12 | ** file are subject only to the provisions of the License. You may not use
|
---|
13 | ** this file except in compliance with the License. You may obtain a copy
|
---|
14 | ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
---|
15 | ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
---|
16 | **
|
---|
17 | ** http://oss.sgi.com/projects/FreeB
|
---|
18 | **
|
---|
19 | ** Note that, as provided in the License, the Software is distributed on an
|
---|
20 | ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
---|
21 | ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
---|
22 | ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
---|
23 | ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
---|
24 | **
|
---|
25 | ** Original Code. The Original Code is: OpenGL Sample Implementation,
|
---|
26 | ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
---|
27 | ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
---|
28 | ** Copyright in any portions created by third parties is as indicated
|
---|
29 | ** elsewhere herein. All Rights Reserved.
|
---|
30 | **
|
---|
31 | ** Additional Notice Provisions: The application programming interfaces
|
---|
32 | ** established by SGI in conjunction with the Original Code are The
|
---|
33 | ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
---|
34 | ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
---|
35 | ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
---|
36 | ** Window System(R) (Version 1.3), released October 19, 1998. This software
|
---|
37 | ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
---|
38 | ** published by SGI, but has not been independently verified as being
|
---|
39 | ** compliant with the OpenGL(R) version 1.2.1 Specification.
|
---|
40 | **
|
---|
41 | */
|
---|
42 |
|
---|
43 | #include <X11/X.h>
|
---|
44 | #include <X11/Xproto.h>
|
---|
45 | #include <X11/Xmd.h>
|
---|
46 | #include <misc.h>
|
---|
47 | #include <dixstruct.h>
|
---|
48 | #include <pixmapstr.h>
|
---|
49 | #include <gcstruct.h>
|
---|
50 | #include <extnsionst.h>
|
---|
51 | #include <resource.h>
|
---|
52 | #include <scrnintstr.h>
|
---|
53 |
|
---|
54 | /*
|
---|
55 | ** The X header misc.h defines these math functions.
|
---|
56 | */
|
---|
57 | #undef abs
|
---|
58 | #undef fabs
|
---|
59 |
|
---|
60 | #define GL_GLEXT_PROTOTYPES /* we want prototypes */
|
---|
61 | #include <GL/gl.h>
|
---|
62 | #include <GL/glxproto.h>
|
---|
63 | #include <GL/glxint.h>
|
---|
64 |
|
---|
65 | /* For glxscreens.h */
|
---|
66 | typedef struct __GLXdrawable __GLXdrawable;
|
---|
67 | typedef struct __GLXcontext __GLXcontext;
|
---|
68 |
|
---|
69 | #include "glxscreens.h"
|
---|
70 | #include "glxdrawable.h"
|
---|
71 | #include "glxcontext.h"
|
---|
72 |
|
---|
73 |
|
---|
74 | #define GLX_SERVER_MAJOR_VERSION 1
|
---|
75 | #define GLX_SERVER_MINOR_VERSION 2
|
---|
76 |
|
---|
77 | #ifndef True
|
---|
78 | #define True 1
|
---|
79 | #endif
|
---|
80 | #ifndef False
|
---|
81 | #define False 0
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | /*
|
---|
85 | ** GLX resources.
|
---|
86 | */
|
---|
87 | typedef XID GLXContextID;
|
---|
88 | typedef XID GLXPixmap;
|
---|
89 | typedef XID GLXDrawable;
|
---|
90 |
|
---|
91 | typedef struct __GLXclientStateRec __GLXclientState;
|
---|
92 |
|
---|
93 | extern __GLXscreen **__glXActiveScreens;
|
---|
94 | extern GLint __glXNumActiveScreens;
|
---|
95 | extern __GLXscreen *__glXgetActiveScreen(int num);
|
---|
96 |
|
---|
97 | /************************************************************************/
|
---|
98 |
|
---|
99 | void GlxSetVisualConfigs(int nconfigs,
|
---|
100 | __GLXvisualConfig *configs, void **privates);
|
---|
101 |
|
---|
102 | struct _glapi_table;
|
---|
103 | void GlxSetRenderTables (struct _glapi_table *table);
|
---|
104 |
|
---|
105 | void __glXScreenInitVisuals(__GLXscreen *screen);
|
---|
106 |
|
---|
107 | /*
|
---|
108 | ** The last context used (from the server's persective) is cached.
|
---|
109 | */
|
---|
110 | extern __GLXcontext *__glXLastContext;
|
---|
111 | extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
|
---|
112 |
|
---|
113 | int __glXError(int error);
|
---|
114 |
|
---|
115 | /*
|
---|
116 | ** Macros to set, unset, and retrieve the flag that says whether a context
|
---|
117 | ** has unflushed commands.
|
---|
118 | */
|
---|
119 | #define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
|
---|
120 | #define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
|
---|
121 | #define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
|
---|
122 |
|
---|
123 | /************************************************************************/
|
---|
124 |
|
---|
125 | typedef struct __GLXprovider __GLXprovider;
|
---|
126 | struct __GLXprovider {
|
---|
127 | __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
|
---|
128 | const char *name;
|
---|
129 | __GLXprovider *next;
|
---|
130 | };
|
---|
131 |
|
---|
132 | void GlxPushProvider(__GLXprovider *provider);
|
---|
133 |
|
---|
134 | void __glXsetEnterLeaveServerFuncs(void (*enter)(void),
|
---|
135 | void (*leave)(void));
|
---|
136 | void __glXenterServer(void);
|
---|
137 | void __glXleaveServer(void);
|
---|
138 |
|
---|
139 | void glxSuspendClients(void);
|
---|
140 | void glxResumeClients(void);
|
---|
141 |
|
---|
142 | /*
|
---|
143 | ** State kept per client.
|
---|
144 | */
|
---|
145 | struct __GLXclientStateRec {
|
---|
146 | /*
|
---|
147 | ** Whether this structure is currently being used to support a client.
|
---|
148 | */
|
---|
149 | Bool inUse;
|
---|
150 |
|
---|
151 | /*
|
---|
152 | ** Buffer for returned data.
|
---|
153 | */
|
---|
154 | GLbyte *returnBuf;
|
---|
155 | GLint returnBufSize;
|
---|
156 |
|
---|
157 | /*
|
---|
158 | ** Keep track of large rendering commands, which span multiple requests.
|
---|
159 | */
|
---|
160 | GLint largeCmdBytesSoFar; /* bytes received so far */
|
---|
161 | GLint largeCmdBytesTotal; /* total bytes expected */
|
---|
162 | GLint largeCmdRequestsSoFar; /* requests received so far */
|
---|
163 | GLint largeCmdRequestsTotal; /* total requests expected */
|
---|
164 | GLbyte *largeCmdBuf;
|
---|
165 | GLint largeCmdBufSize;
|
---|
166 |
|
---|
167 | /*
|
---|
168 | ** Keep a list of all the contexts that are current for this client's
|
---|
169 | ** threads.
|
---|
170 | */
|
---|
171 | __GLXcontext **currentContexts;
|
---|
172 | GLint numCurrentContexts;
|
---|
173 |
|
---|
174 | /* Back pointer to X client record */
|
---|
175 | ClientPtr client;
|
---|
176 |
|
---|
177 | int GLClientmajorVersion;
|
---|
178 | int GLClientminorVersion;
|
---|
179 | char *GLClientextensions;
|
---|
180 | };
|
---|
181 |
|
---|
182 | /************************************************************************/
|
---|
183 |
|
---|
184 | /*
|
---|
185 | ** Dispatch tables.
|
---|
186 | */
|
---|
187 | typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
|
---|
188 | typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
|
---|
189 | typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
|
---|
190 |
|
---|
191 | /*
|
---|
192 | * Dispatch for GLX commands.
|
---|
193 | */
|
---|
194 | typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
|
---|
195 |
|
---|
196 | /*
|
---|
197 | * Tables for computing the size of each rendering command.
|
---|
198 | */
|
---|
199 | typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
|
---|
200 |
|
---|
201 | typedef struct {
|
---|
202 | int bytes;
|
---|
203 | gl_proto_size_func varsize;
|
---|
204 | } __GLXrenderSizeData;
|
---|
205 |
|
---|
206 | /************************************************************************/
|
---|
207 |
|
---|
208 | /*
|
---|
209 | ** X resources.
|
---|
210 | */
|
---|
211 | extern RESTYPE __glXContextRes;
|
---|
212 | extern RESTYPE __glXClientRes;
|
---|
213 | extern RESTYPE __glXPixmapRes;
|
---|
214 | extern RESTYPE __glXDrawableRes;
|
---|
215 |
|
---|
216 | /************************************************************************/
|
---|
217 |
|
---|
218 | /*
|
---|
219 | ** Prototypes.
|
---|
220 | */
|
---|
221 |
|
---|
222 | extern char *__glXcombine_strings(const char *, const char *);
|
---|
223 |
|
---|
224 | /*
|
---|
225 | ** Routines for sending swapped replies.
|
---|
226 | */
|
---|
227 |
|
---|
228 | extern void __glXSwapMakeCurrentReply(ClientPtr client,
|
---|
229 | xGLXMakeCurrentReply *reply);
|
---|
230 | extern void __glXSwapIsDirectReply(ClientPtr client,
|
---|
231 | xGLXIsDirectReply *reply);
|
---|
232 | extern void __glXSwapQueryVersionReply(ClientPtr client,
|
---|
233 | xGLXQueryVersionReply *reply);
|
---|
234 | extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
|
---|
235 | xGLXQueryContextInfoEXTReply *reply,
|
---|
236 | int *buf);
|
---|
237 | extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
|
---|
238 | xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
|
---|
239 | extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
|
---|
240 | xGLXQueryExtensionsStringReply *reply, char *buf);
|
---|
241 | extern void glxSwapQueryServerStringReply(ClientPtr client,
|
---|
242 | xGLXQueryServerStringReply *reply, char *buf);
|
---|
243 |
|
---|
244 |
|
---|
245 | /*
|
---|
246 | * Routines for computing the size of variably-sized rendering commands.
|
---|
247 | */
|
---|
248 |
|
---|
249 | extern int __glXTypeSize(GLenum enm);
|
---|
250 | extern int __glXImageSize(GLenum format, GLenum type,
|
---|
251 | GLenum target, GLsizei w, GLsizei h, GLsizei d,
|
---|
252 | GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
|
---|
253 | GLint alignment);
|
---|
254 |
|
---|
255 | #endif /* !__GLX_server_h__ */
|
---|