1
#ifdef HAVE_DIX_CONFIG_H
2
#include <dix-config.h>
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:
17
** http://oss.sgi.com/projects/FreeB
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.
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.
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.
44
#include <X11/Xproto.h>
47
#include <dixstruct.h>
48
#include <pixmapstr.h>
50
#include <extnsionst.h>
52
#include <scrnintstr.h>
55
** The X header misc.h defines these math functions.
60
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
62
#include <GL/glxproto.h>
63
#include <GL/glxint.h>
65
/* For glxscreens.h */
66
typedef struct __GLXdrawable __GLXdrawable;
67
typedef struct __GLXcontext __GLXcontext;
69
#include "glxscreens.h"
70
#include "glxdrawable.h"
71
#include "glxcontext.h"
74
#define GLX_SERVER_MAJOR_VERSION 1
75
#define GLX_SERVER_MINOR_VERSION 2
87
typedef XID GLXContextID;
88
typedef XID GLXPixmap;
89
typedef XID GLXDrawable;
91
typedef struct __GLXclientStateRec __GLXclientState;
93
extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
94
extern __GLXclientState *glxGetClient(ClientPtr pClient);
96
/************************************************************************/
98
void GlxExtensionInit(void);
100
void GlxSetVisualConfigs(int nconfigs,
101
__GLXvisualConfig *configs, void **privates);
104
void GlxSetRenderTables (struct _glapi_table *table);
106
void __glXScreenInitVisuals(__GLXscreen *screen);
109
** The last context used (from the server's persective) is cached.
111
extern __GLXcontext *__glXLastContext;
112
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
114
extern ClientPtr __pGlxClient;
116
int __glXError(int error);
119
** Macros to set, unset, and retrieve the flag that says whether a context
120
** has unflushed commands.
122
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
123
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
124
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
126
/************************************************************************/
128
typedef struct __GLXprovider __GLXprovider;
129
struct __GLXprovider {
130
__GLXscreen *(*screenProbe)(ScreenPtr pScreen);
135
void GlxPushProvider(__GLXprovider *provider);
143
void GlxSetVisualConfig(int config);
145
void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
146
void (*leave)(GLboolean));
147
void __glXenterServer(GLboolean rendering);
148
void __glXleaveServer(GLboolean rendering);
150
void glxSuspendClients(void);
151
void glxResumeClients(void);
154
** State kept per client.
156
struct __GLXclientStateRec {
158
** Whether this structure is currently being used to support a client.
163
** Buffer for returned data.
169
** Keep track of large rendering commands, which span multiple requests.
171
GLint largeCmdBytesSoFar; /* bytes received so far */
172
GLint largeCmdBytesTotal; /* total bytes expected */
173
GLint largeCmdRequestsSoFar; /* requests received so far */
174
GLint largeCmdRequestsTotal; /* total requests expected */
176
GLint largeCmdBufSize;
179
** Keep a list of all the contexts that are current for this client's
182
__GLXcontext **currentContexts;
183
GLint numCurrentContexts;
185
/* Back pointer to X client record */
188
int GLClientmajorVersion;
189
int GLClientminorVersion;
190
char *GLClientextensions;
193
/************************************************************************/
198
typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
199
typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
200
typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
203
* Dispatch for GLX commands.
205
typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
208
* Tables for computing the size of each rendering command.
210
typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
214
gl_proto_size_func varsize;
215
} __GLXrenderSizeData;
217
/************************************************************************/
222
extern RESTYPE __glXContextRes;
223
extern RESTYPE __glXClientRes;
224
extern RESTYPE __glXPixmapRes;
225
extern RESTYPE __glXDrawableRes;
227
/************************************************************************/
233
extern char *__glXcombine_strings(const char *, const char *);
236
** Routines for sending swapped replies.
239
extern void __glXSwapMakeCurrentReply(ClientPtr client,
240
xGLXMakeCurrentReply *reply);
241
extern void __glXSwapIsDirectReply(ClientPtr client,
242
xGLXIsDirectReply *reply);
243
extern void __glXSwapQueryVersionReply(ClientPtr client,
244
xGLXQueryVersionReply *reply);
245
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
246
xGLXQueryContextInfoEXTReply *reply,
248
extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
249
xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
250
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
251
xGLXQueryExtensionsStringReply *reply, char *buf);
252
extern void glxSwapQueryServerStringReply(ClientPtr client,
253
xGLXQueryServerStringReply *reply, char *buf);
257
* Routines for computing the size of variably-sized rendering commands.
260
extern int __glXTypeSize(GLenum enm);
261
extern int __glXImageSize(GLenum format, GLenum type,
262
GLenum target, GLsizei w, GLsizei h, GLsizei d,
263
GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
266
#endif /* !__GLX_server_h__ */