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>
49 #define GL_GLEXT_PROTOTYPES /* we want prototypes */
52 #include <GL/glxproto.h>
57 typedef XID GLXContextID
;
58 typedef XID GLXPixmap
;
59 typedef XID GLXDrawable
;
61 typedef struct __GLXclientStateRec __GLXclientState
;
62 typedef struct __GLXdrawable __GLXdrawable
;
63 typedef struct __GLXcontext __GLXcontext
;
65 #include "glxscreens.h"
66 #include "glxdrawable.h"
67 #include "glxcontext.h"
76 extern __GLXscreen
*glxGetScreen(ScreenPtr pScreen
);
77 extern __GLXclientState
*glxGetClient(ClientPtr pClient
);
79 /************************************************************************/
81 void GlxSetVisualConfigs(int nconfigs
, void *configs
, void **privates
);
83 void __glXScreenInitVisuals(__GLXscreen
* screen
);
86 ** The last context used (from the server's persective) is cached.
88 extern __GLXcontext
*__glXLastContext
;
89 extern __GLXcontext
*__glXForceCurrent(__GLXclientState
*, GLXContextTag
,
92 int __glXError(int error
);
94 /************************************************************************/
96 typedef struct __GLXprovider __GLXprovider
;
97 struct __GLXprovider
{
98 __GLXscreen
*(*screenProbe
) (ScreenPtr pScreen
);
102 extern __GLXprovider __glXDRISWRastProvider
;
104 void GlxPushProvider(__GLXprovider
* provider
);
112 void __glXsetEnterLeaveServerFuncs(void (*enter
) (GLboolean
),
113 void (*leave
) (GLboolean
));
114 void __glXenterServer(GLboolean rendering
);
115 void __glXleaveServer(GLboolean rendering
);
117 void glxSuspendClients(void);
118 void glxResumeClients(void);
120 typedef void (*glx_func_ptr
)(void);
121 typedef glx_func_ptr (*glx_gpa_proc
)(const char *);
122 void __glXsetGetProcAddress(glx_gpa_proc get_proc_address
);
123 void *__glGetProcAddress(const char *);
126 __glXsendSwapEvent(__GLXdrawable
*drawable
, int type
, CARD64 ust
,
127 CARD64 msc
, CARD32 sbc
);
131 __glXregisterPresentCompleteNotify(void);
135 ** State kept per client.
137 struct __GLXclientStateRec
{
139 ** Whether this structure is currently being used to support a client.
144 ** Buffer for returned data.
150 ** Keep track of large rendering commands, which span multiple requests.
152 GLint largeCmdBytesSoFar
; /* bytes received so far */
153 GLint largeCmdBytesTotal
; /* total bytes expected */
154 GLint largeCmdRequestsSoFar
; /* requests received so far */
155 GLint largeCmdRequestsTotal
; /* total requests expected */
157 GLint largeCmdBufSize
;
159 /* Back pointer to X client record */
162 char *GLClientextensions
;
165 /************************************************************************/
170 typedef void (*__GLXdispatchRenderProcPtr
) (GLbyte
*);
171 typedef int (*__GLXdispatchSingleProcPtr
) (__GLXclientState
*, GLbyte
*);
172 typedef int (*__GLXdispatchVendorPrivProcPtr
) (__GLXclientState
*, GLbyte
*);
175 * Dispatch for GLX commands.
177 typedef int (*__GLXprocPtr
) (__GLXclientState
*, char *pc
);
180 * Tables for computing the size of each rendering command.
182 typedef int (*gl_proto_size_func
) (const GLbyte
*, Bool
);
186 gl_proto_size_func varsize
;
187 } __GLXrenderSizeData
;
189 /************************************************************************/
194 extern RESTYPE __glXContextRes
;
195 extern RESTYPE __glXClientRes
;
196 extern RESTYPE __glXPixmapRes
;
197 extern RESTYPE __glXDrawableRes
;
199 /************************************************************************/
205 extern char *__glXcombine_strings(const char *, const char *);
208 ** Routines for sending swapped replies.
211 extern void __glXSwapMakeCurrentReply(ClientPtr client
,
212 xGLXMakeCurrentReply
* reply
);
213 extern void __glXSwapIsDirectReply(ClientPtr client
, xGLXIsDirectReply
* reply
);
214 extern void __glXSwapQueryVersionReply(ClientPtr client
,
215 xGLXQueryVersionReply
* reply
);
216 extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client
,
217 xGLXQueryContextInfoEXTReply
*
219 extern void __glXSwapGetDrawableAttributesReply(ClientPtr client
,
220 xGLXGetDrawableAttributesReply
*
222 extern void glxSwapQueryExtensionsStringReply(ClientPtr client
,
223 xGLXQueryExtensionsStringReply
*
225 extern void glxSwapQueryServerStringReply(ClientPtr client
,
226 xGLXQueryServerStringReply
* reply
,
230 * Routines for computing the size of variably-sized rendering commands.
233 extern int __glXTypeSize(GLenum enm
);
234 extern int __glXImageSize(GLenum format
, GLenum type
,
235 GLenum target
, GLsizei w
, GLsizei h
, GLsizei d
,
236 GLint imageHeight
, GLint rowLength
, GLint skipImages
,
237 GLint skipRows
, GLint alignment
);
239 extern unsigned glxMajorVersion
;
240 extern unsigned glxMinorVersion
;
242 extern int __glXEventBase
;
244 #endif /* !__GLX_server_h__ */