VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.6.99-20090831/glxserver.h@ 23298

Last change on this file since 23298 was 22658, checked in by vboxsync, 15 years ago

export Xorg 1.6.99 headers to OSE

  • Property svn:eol-style set to native
File size: 7.1 KB
Line 
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/*
50** The X header misc.h defines these math functions.
51*/
52#undef abs
53#undef fabs
54
55#define GL_GLEXT_PROTOTYPES /* we want prototypes */
56#include <GL/gl.h>
57#include <GL/glxproto.h>
58
59/* For glxscreens.h */
60typedef struct __GLXdrawable __GLXdrawable;
61typedef struct __GLXcontext __GLXcontext;
62
63#include "glxscreens.h"
64#include "glxdrawable.h"
65#include "glxcontext.h"
66
67
68#define GLX_SERVER_MAJOR_VERSION 1
69#define GLX_SERVER_MINOR_VERSION 2
70
71#ifndef True
72#define True 1
73#endif
74#ifndef False
75#define False 0
76#endif
77
78/*
79** GLX resources.
80*/
81typedef XID GLXContextID;
82typedef XID GLXPixmap;
83typedef XID GLXDrawable;
84
85typedef struct __GLXclientStateRec __GLXclientState;
86
87extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
88extern __GLXclientState *glxGetClient(ClientPtr pClient);
89
90/************************************************************************/
91
92void GlxExtensionInit(void);
93
94void GlxSetVisualConfigs(int nconfigs,
95 void *configs, void **privates);
96
97void __glXScreenInitVisuals(__GLXscreen *screen);
98
99/*
100** The last context used (from the server's persective) is cached.
101*/
102extern __GLXcontext *__glXLastContext;
103extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
104
105extern ClientPtr __pGlxClient;
106
107int __glXError(int error);
108
109/*
110** Macros to set, unset, and retrieve the flag that says whether a context
111** has unflushed commands.
112*/
113#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
114#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
115#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
116
117/************************************************************************/
118
119typedef struct __GLXprovider __GLXprovider;
120struct __GLXprovider {
121 __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
122 const char *name;
123 __GLXprovider *next;
124};
125
126void GlxPushProvider(__GLXprovider *provider);
127
128enum {
129 GLX_MINIMAL_VISUALS,
130 GLX_TYPICAL_VISUALS,
131 GLX_ALL_VISUALS
132};
133
134void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
135 void (*leave)(GLboolean));
136void __glXenterServer(GLboolean rendering);
137void __glXleaveServer(GLboolean rendering);
138
139void glxSuspendClients(void);
140void glxResumeClients(void);
141
142/*
143** State kept per client.
144*/
145struct __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*/
187typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
188typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
189typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
190
191/*
192 * Dispatch for GLX commands.
193 */
194typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
195
196/*
197 * Tables for computing the size of each rendering command.
198 */
199typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
200
201typedef struct {
202 int bytes;
203 gl_proto_size_func varsize;
204} __GLXrenderSizeData;
205
206/************************************************************************/
207
208/*
209** X resources.
210*/
211extern RESTYPE __glXContextRes;
212extern RESTYPE __glXClientRes;
213extern RESTYPE __glXPixmapRes;
214extern RESTYPE __glXDrawableRes;
215
216/************************************************************************/
217
218/*
219** Prototypes.
220*/
221
222extern char *__glXcombine_strings(const char *, const char *);
223
224/*
225** Routines for sending swapped replies.
226*/
227
228extern void __glXSwapMakeCurrentReply(ClientPtr client,
229 xGLXMakeCurrentReply *reply);
230extern void __glXSwapIsDirectReply(ClientPtr client,
231 xGLXIsDirectReply *reply);
232extern void __glXSwapQueryVersionReply(ClientPtr client,
233 xGLXQueryVersionReply *reply);
234extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
235 xGLXQueryContextInfoEXTReply *reply,
236 int *buf);
237extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
238 xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
239extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
240 xGLXQueryExtensionsStringReply *reply, char *buf);
241extern 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
249extern int __glXTypeSize(GLenum enm);
250extern 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__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette