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 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
---|
10 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
---|
11 | *
|
---|
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:
|
---|
18 | *
|
---|
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.
|
---|
23 | *
|
---|
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
|
---|
30 | * SOFTWARE.
|
---|
31 | *
|
---|
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.
|
---|
36 | */
|
---|
37 |
|
---|
38 | #include <X11/X.h>
|
---|
39 | #include <X11/Xproto.h>
|
---|
40 | #include <X11/Xmd.h>
|
---|
41 | #include <misc.h>
|
---|
42 | #include <dixstruct.h>
|
---|
43 | #include <pixmapstr.h>
|
---|
44 | #include <gcstruct.h>
|
---|
45 | #include <extnsionst.h>
|
---|
46 | #include <resource.h>
|
---|
47 | #include <scrnintstr.h>
|
---|
48 |
|
---|
49 | #include <GL/gl.h>
|
---|
50 | #include <GL/glxproto.h>
|
---|
51 |
|
---|
52 | /*
|
---|
53 | ** GLX resources.
|
---|
54 | */
|
---|
55 | typedef XID GLXContextID;
|
---|
56 | typedef XID GLXPixmap;
|
---|
57 | typedef XID GLXDrawable;
|
---|
58 |
|
---|
59 | typedef struct __GLXclientStateRec __GLXclientState;
|
---|
60 | typedef struct __GLXdrawable __GLXdrawable;
|
---|
61 | typedef struct __GLXcontext __GLXcontext;
|
---|
62 |
|
---|
63 | #include "glxscreens.h"
|
---|
64 | #include "glxdrawable.h"
|
---|
65 | #include "glxcontext.h"
|
---|
66 |
|
---|
67 | #ifndef True
|
---|
68 | #define True 1
|
---|
69 | #endif
|
---|
70 | #ifndef False
|
---|
71 | #define False 0
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
|
---|
75 | extern __GLXclientState *glxGetClient(ClientPtr pClient);
|
---|
76 |
|
---|
77 | /************************************************************************/
|
---|
78 |
|
---|
79 | void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates);
|
---|
80 |
|
---|
81 | void __glXScreenInitVisuals(__GLXscreen * screen);
|
---|
82 |
|
---|
83 | /*
|
---|
84 | ** The last context used (from the server's persective) is cached.
|
---|
85 | */
|
---|
86 | extern __GLXcontext *__glXLastContext;
|
---|
87 | extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag,
|
---|
88 | int *);
|
---|
89 |
|
---|
90 | int __glXError(int error);
|
---|
91 |
|
---|
92 | /************************************************************************/
|
---|
93 |
|
---|
94 | typedef struct __GLXprovider __GLXprovider;
|
---|
95 | struct __GLXprovider {
|
---|
96 | __GLXscreen *(*screenProbe) (ScreenPtr pScreen);
|
---|
97 | const char *name;
|
---|
98 | __GLXprovider *next;
|
---|
99 | };
|
---|
100 | extern __GLXprovider __glXDRISWRastProvider;
|
---|
101 |
|
---|
102 | void GlxPushProvider(__GLXprovider * provider);
|
---|
103 |
|
---|
104 | enum {
|
---|
105 | GLX_MINIMAL_VISUALS,
|
---|
106 | GLX_TYPICAL_VISUALS,
|
---|
107 | GLX_ALL_VISUALS
|
---|
108 | };
|
---|
109 |
|
---|
110 | void __glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean),
|
---|
111 | void (*leave) (GLboolean));
|
---|
112 | void __glXenterServer(GLboolean rendering);
|
---|
113 | void __glXleaveServer(GLboolean rendering);
|
---|
114 |
|
---|
115 | void glxSuspendClients(void);
|
---|
116 | void glxResumeClients(void);
|
---|
117 |
|
---|
118 | /*
|
---|
119 | ** State kept per client.
|
---|
120 | */
|
---|
121 | struct __GLXclientStateRec {
|
---|
122 | /*
|
---|
123 | ** Whether this structure is currently being used to support a client.
|
---|
124 | */
|
---|
125 | Bool inUse;
|
---|
126 |
|
---|
127 | /*
|
---|
128 | ** Buffer for returned data.
|
---|
129 | */
|
---|
130 | GLbyte *returnBuf;
|
---|
131 | GLint returnBufSize;
|
---|
132 |
|
---|
133 | /*
|
---|
134 | ** Keep track of large rendering commands, which span multiple requests.
|
---|
135 | */
|
---|
136 | GLint largeCmdBytesSoFar; /* bytes received so far */
|
---|
137 | GLint largeCmdBytesTotal; /* total bytes expected */
|
---|
138 | GLint largeCmdRequestsSoFar; /* requests received so far */
|
---|
139 | GLint largeCmdRequestsTotal; /* total requests expected */
|
---|
140 | GLbyte *largeCmdBuf;
|
---|
141 | GLint largeCmdBufSize;
|
---|
142 |
|
---|
143 | /* Back pointer to X client record */
|
---|
144 | ClientPtr client;
|
---|
145 |
|
---|
146 | char *GLClientextensions;
|
---|
147 | };
|
---|
148 |
|
---|
149 | /************************************************************************/
|
---|
150 |
|
---|
151 | /*
|
---|
152 | ** Dispatch tables.
|
---|
153 | */
|
---|
154 | typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *);
|
---|
155 | typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *);
|
---|
156 | typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *);
|
---|
157 |
|
---|
158 | /*
|
---|
159 | * Dispatch for GLX commands.
|
---|
160 | */
|
---|
161 | typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
|
---|
162 |
|
---|
163 | /*
|
---|
164 | * Tables for computing the size of each rendering command.
|
---|
165 | */
|
---|
166 | typedef int (*gl_proto_size_func) (const GLbyte *, Bool);
|
---|
167 |
|
---|
168 | typedef struct {
|
---|
169 | int bytes;
|
---|
170 | gl_proto_size_func varsize;
|
---|
171 | } __GLXrenderSizeData;
|
---|
172 |
|
---|
173 | /************************************************************************/
|
---|
174 |
|
---|
175 | /*
|
---|
176 | ** X resources.
|
---|
177 | */
|
---|
178 | extern RESTYPE __glXContextRes;
|
---|
179 | extern RESTYPE __glXClientRes;
|
---|
180 | extern RESTYPE __glXPixmapRes;
|
---|
181 | extern RESTYPE __glXDrawableRes;
|
---|
182 |
|
---|
183 | /************************************************************************/
|
---|
184 |
|
---|
185 | /*
|
---|
186 | ** Prototypes.
|
---|
187 | */
|
---|
188 |
|
---|
189 | extern char *__glXcombine_strings(const char *, const char *);
|
---|
190 |
|
---|
191 | /*
|
---|
192 | ** Routines for sending swapped replies.
|
---|
193 | */
|
---|
194 |
|
---|
195 | extern void __glXSwapMakeCurrentReply(ClientPtr client,
|
---|
196 | xGLXMakeCurrentReply * reply);
|
---|
197 | extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply);
|
---|
198 | extern void __glXSwapQueryVersionReply(ClientPtr client,
|
---|
199 | xGLXQueryVersionReply * reply);
|
---|
200 | extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
|
---|
201 | xGLXQueryContextInfoEXTReply *
|
---|
202 | reply, int *buf);
|
---|
203 | extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
|
---|
204 | xGLXGetDrawableAttributesReply *
|
---|
205 | reply, CARD32 *buf);
|
---|
206 | extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
|
---|
207 | xGLXQueryExtensionsStringReply *
|
---|
208 | reply, char *buf);
|
---|
209 | extern void glxSwapQueryServerStringReply(ClientPtr client,
|
---|
210 | xGLXQueryServerStringReply * reply,
|
---|
211 | char *buf);
|
---|
212 |
|
---|
213 | /*
|
---|
214 | * Routines for computing the size of variably-sized rendering commands.
|
---|
215 | */
|
---|
216 |
|
---|
217 | extern int __glXTypeSize(GLenum enm);
|
---|
218 | extern int __glXImageSize(GLenum format, GLenum type,
|
---|
219 | GLenum target, GLsizei w, GLsizei h, GLsizei d,
|
---|
220 | GLint imageHeight, GLint rowLength, GLint skipImages,
|
---|
221 | GLint skipRows, GLint alignment);
|
---|
222 |
|
---|
223 | extern unsigned glxMajorVersion;
|
---|
224 | extern unsigned glxMinorVersion;
|
---|
225 |
|
---|
226 | extern int __glXEventBase;
|
---|
227 |
|
---|
228 | #endif /* !__GLX_server_h__ */
|
---|