VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.11.0/glxserver.h

Last change on this file was 38824, checked in by vboxsync, 13 years ago

Additions/x11: header files for building X.Org Server 1.11 modules

  • Property svn:eol-style set to native
File size: 10.5 KB
Line 
1#ifndef _GLX_server_h_
2#define _GLX_server_h_
3
4/*
5 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
6 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice including the dates of first publication and
16 * either this permission notice or a reference to
17 * http://oss.sgi.com/projects/FreeB/
18 * shall be included in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 *
28 * Except as contained in this notice, the name of Silicon Graphics, Inc.
29 * shall not be used in advertising or otherwise to promote the sale, use or
30 * other dealings in this Software without prior written authorization from
31 * Silicon Graphics, Inc.
32 */
33
34#include "dmx.h"
35
36#include <misc.h>
37#include <dixstruct.h>
38#include <pixmapstr.h>
39#include <gcstruct.h>
40#include <extnsionst.h>
41#include <resource.h>
42#include <scrnintstr.h>
43
44
45/*
46** The X header misc.h defines these math functions.
47*/
48#undef abs
49#undef fabs
50
51#define GL_GLEXT_PROTOTYPES /* we want prototypes */
52#include <GL/gl.h>
53#include <GL/glxproto.h>
54#include <GL/glxint.h>
55
56#include "glxscreens.h"
57#include "glxdrawable.h"
58#include "glxcontext.h"
59#include "glxerror.h"
60
61
62#define GLX_SERVER_MAJOR_VERSION 1
63#define GLX_SERVER_MINOR_VERSION 3
64
65#ifndef True
66#define True 1
67#endif
68#ifndef False
69#define False 0
70#endif
71
72/*
73** GLX resources.
74typedef XID GLXContextID;
75typedef XID GLXPixmap;
76typedef XID GLXDrawable;
77typedef XID GLXWindow;
78typedef XID GLXPbuffer;
79
80typedef struct __GLXcontextRec *GLXContext;
81*/
82typedef struct __GLXclientStateRec __GLXclientState;
83
84extern __GLXscreenInfo *__glXActiveScreens;
85extern GLint __glXNumActiveScreens;
86
87/************************************************************************/
88
89/*
90** The last context used (from the server's persective) is cached.
91*/
92extern __GLXcontext *__glXLastContext;
93extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
94
95/************************************************************************/
96
97typedef struct {
98 int elem_size; /* element size in bytes */
99 int nelems; /* number of elements to swap */
100 void (*swapfunc)(GLbyte *pc);
101} __GLXRenderSwapInfo;
102
103/*
104** State kept per client.
105*/
106struct __GLXclientStateRec {
107 /*
108 ** Whether this structure is currently being used to support a client.
109 */
110 Bool inUse;
111
112 /*
113 ** Buffer for returned data.
114 */
115 GLbyte *returnBuf;
116 GLint returnBufSize;
117
118 /*
119 ** Keep a list of all the contexts that are current for this client's
120 ** threads.
121 */
122 __GLXcontext **currentContexts;
123 DrawablePtr *currentDrawables;
124 GLint numCurrentContexts;
125
126 /* Back pointer to X client record */
127 ClientPtr client;
128
129 int GLClientmajorVersion;
130 int GLClientminorVersion;
131 char *GLClientextensions;
132
133 GLXContextTag *be_currentCTag;
134 Display **be_displays;
135
136 /*
137 ** Keep track of large rendering commands, which span multiple requests.
138 */
139 GLint largeCmdBytesSoFar; /* bytes received so far */
140 GLint largeCmdBytesTotal; /* total bytes expected */
141 GLint largeCmdRequestsSoFar; /* requests received so far */
142 GLint largeCmdRequestsTotal; /* total requests expected */
143 void (*largeCmdRequestsSwapProc)(GLbyte *);
144 __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
145 GLbyte *largeCmdBuf;
146 GLint largeCmdBufSize;
147 GLint largeCmdMaxReqDataSize;
148
149};
150
151extern __GLXclientState *__glXClients[];
152
153/************************************************************************/
154
155/*
156** Dispatch tables.
157*/
158typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
159typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
160typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
161extern __GLXdispatchSingleProcPtr __glXSingleTable[];
162extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
163extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
164extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
165extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
166
167extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
168
169/*
170 * Dispatch for GLX commands.
171 */
172typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
173extern __GLXprocPtr __glXProcTable[];
174
175/*
176 * Tables for computing the size of each rendering command.
177 */
178typedef struct {
179 int bytes;
180 int (*varsize)(GLbyte *pc, Bool swap);
181} __GLXrenderSizeData;
182extern __GLXrenderSizeData __glXRenderSizeTable[];
183extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
184
185/************************************************************************/
186
187/*
188** X resources.
189*/
190extern RESTYPE __glXContextRes;
191extern RESTYPE __glXClientRes;
192extern RESTYPE __glXPixmapRes;
193extern RESTYPE __glXDrawableRes;
194extern RESTYPE __glXWindowRes;
195extern RESTYPE __glXPbufferRes;
196
197/************************************************************************/
198
199/*
200** Prototypes.
201*/
202
203
204extern char *__glXcombine_strings(const char *, const char *);
205
206extern void __glXDisp_DrawArrays(GLbyte*);
207extern void __glXDispSwap_DrawArrays(GLbyte*);
208
209
210/*
211** Routines for sending swapped replies.
212*/
213
214extern void __glXSwapMakeCurrentReply(ClientPtr client,
215 xGLXMakeCurrentReadSGIReply *reply);
216
217extern void __glXSwapIsDirectReply(ClientPtr client,
218 xGLXIsDirectReply *reply);
219extern void __glXSwapQueryVersionReply(ClientPtr client,
220 xGLXQueryVersionReply *reply);
221extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
222 xGLXQueryContextInfoEXTReply *reply,
223 int *buf);
224extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
225 xGLXQueryExtensionsStringReply *reply, char *buf);
226extern void glxSwapQueryServerStringReply(ClientPtr client,
227 xGLXQueryServerStringReply *reply, char *buf);
228extern void __glXSwapQueryContextReply(ClientPtr client,
229 xGLXQueryContextReply *reply, int *buf);
230extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
231 xGLXGetDrawableAttributesReply *reply, int *buf);
232extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
233 xGLXQueryMaxSwapBarriersSGIXReply *reply);
234
235/*
236 * Routines for computing the size of variably-sized rendering commands.
237 */
238
239extern int __glXTypeSize(GLenum enm);
240extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
241 GLint rowLength, GLint skipRows, GLint alignment);
242extern int __glXImage3DSize(GLenum format, GLenum type,
243 GLsizei w, GLsizei h, GLsizei d,
244 GLint imageHeight, GLint rowLength,
245 GLint skipImages, GLint skipRows,
246 GLint alignment);
247
248extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
249extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
250extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
251extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
252extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
253extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
254extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
255extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
256extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
257extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
258extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
259extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
260extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
261extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
262extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
263extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
264extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
265extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
266extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
267extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
268extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
269extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
270extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
271extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
272extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
273extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
274extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
275extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
276extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
277extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
278extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
279extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
280extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
281extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
282extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
283extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
284extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
285extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
286extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
287extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
288extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
289extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
290
291/*
292 * Routines for computing the size of returned data.
293 */
294extern int __glXConvolutionParameterivSize(GLenum pname);
295extern int __glXConvolutionParameterfvSize(GLenum pname);
296extern int __glXColorTableParameterfvSize(GLenum pname);
297extern int __glXColorTableParameterivSize(GLenum pname);
298
299extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
300extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer);
301
302extern int __glXVersionMajor;
303extern int __glXVersionMinor;
304
305#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
306 ( (__glXVersionMajor > (major)) || \
307 ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
308
309#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