VirtualBox

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

Last change on this file since 78293 was 58634, checked in by vboxsync, 9 years ago

Additions/x11: added header files for building X.Org video driver against X.Org Server 1.18.

  • Property svn:eol-style set to native
File size: 10.7 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#define GL_GLEXT_PROTOTYPES /* we want prototypes */
45#include <GL/gl.h>
46#include <GL/glxproto.h>
47#include <GL/glxint.h>
48
49#include "glxscreens.h"
50#include "glxdrawable.h"
51#include "glxcontext.h"
52#include "glxerror.h"
53
54#define GLX_SERVER_MAJOR_VERSION 1
55#define GLX_SERVER_MINOR_VERSION 3
56
57#ifndef True
58#define True 1
59#endif
60#ifndef False
61#define False 0
62#endif
63
64/*
65** GLX resources.
66typedef XID GLXContextID;
67typedef XID GLXPixmap;
68typedef XID GLXDrawable;
69typedef XID GLXWindow;
70typedef XID GLXPbuffer;
71
72typedef struct __GLXcontextRec *GLXContext;
73*/
74typedef struct __GLXclientStateRec __GLXclientState;
75
76extern __GLXscreenInfo *__glXActiveScreens;
77extern GLint __glXNumActiveScreens;
78
79/************************************************************************/
80
81/*
82** The last context used (from the server's persective) is cached.
83*/
84extern __GLXcontext *__glXLastContext;
85extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag,
86 int *);
87
88/************************************************************************/
89
90typedef struct {
91 int elem_size; /* element size in bytes */
92 int nelems; /* number of elements to swap */
93 void (*swapfunc) (GLbyte * pc);
94} __GLXRenderSwapInfo;
95
96/*
97** State kept per client.
98*/
99struct __GLXclientStateRec {
100 /*
101 ** Whether this structure is currently being used to support a client.
102 */
103 Bool inUse;
104
105 /*
106 ** Buffer for returned data.
107 */
108 GLbyte *returnBuf;
109 GLint returnBufSize;
110
111 /*
112 ** Keep a list of all the contexts that are current for this client's
113 ** threads.
114 */
115 __GLXcontext **currentContexts;
116 DrawablePtr *currentDrawables;
117 GLint numCurrentContexts;
118
119 /* Back pointer to X client record */
120 ClientPtr client;
121
122 char *GLClientextensions;
123
124 GLXContextTag *be_currentCTag;
125 Display **be_displays;
126
127 /*
128 ** Keep track of large rendering commands, which span multiple requests.
129 */
130 GLint largeCmdBytesSoFar; /* bytes received so far */
131 GLint largeCmdBytesTotal; /* total bytes expected */
132 GLint largeCmdRequestsSoFar; /* requests received so far */
133 GLint largeCmdRequestsTotal; /* total requests expected */
134 void (*largeCmdRequestsSwapProc) (GLbyte *);
135 __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
136 GLbyte *largeCmdBuf;
137 GLint largeCmdBufSize;
138 GLint largeCmdMaxReqDataSize;
139
140};
141
142extern __GLXclientState *__glXClients[];
143
144/************************************************************************/
145
146/*
147** Dispatch tables.
148*/
149typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *);
150typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *);
151typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *);
152extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
153extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
154extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
155
156extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
157
158/*
159 * Dispatch for GLX commands.
160 */
161typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
162extern __GLXprocPtr __glXProcTable[];
163
164/*
165 * Tables for computing the size of each rendering command.
166 */
167typedef struct {
168 int bytes;
169 int (*varsize) (GLbyte * pc, Bool swap);
170} __GLXrenderSizeData;
171extern __GLXrenderSizeData __glXRenderSizeTable[];
172extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
173
174/************************************************************************/
175
176/*
177** X resources.
178*/
179extern RESTYPE __glXContextRes;
180extern RESTYPE __glXClientRes;
181extern RESTYPE __glXPixmapRes;
182extern RESTYPE __glXDrawableRes;
183extern RESTYPE __glXWindowRes;
184extern RESTYPE __glXPbufferRes;
185
186/************************************************************************/
187
188/*
189** Prototypes.
190*/
191
192extern char *__glXcombine_strings(const char *, const char *);
193
194/*
195** Routines for sending swapped replies.
196*/
197
198extern void __glXSwapMakeCurrentReply(ClientPtr client,
199 xGLXMakeCurrentReadSGIReply * reply);
200
201extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply);
202extern void __glXSwapQueryVersionReply(ClientPtr client,
203 xGLXQueryVersionReply * reply);
204extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
205 xGLXQueryContextInfoEXTReply *
206 reply, int *buf);
207extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
208 xGLXQueryExtensionsStringReply *
209 reply, char *buf);
210extern void glxSwapQueryServerStringReply(ClientPtr client,
211 xGLXQueryServerStringReply * reply,
212 char *buf);
213extern void __glXSwapQueryContextReply(ClientPtr client,
214 xGLXQueryContextReply * reply, int *buf);
215extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
216 xGLXGetDrawableAttributesReply *
217 reply, int *buf);
218extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
219 xGLXQueryMaxSwapBarriersSGIXReply
220 * reply);
221
222/*
223 * Routines for computing the size of variably-sized rendering commands.
224 */
225
226extern int __glXTypeSize(GLenum enm);
227extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
228 GLint rowLength, GLint skipRows, GLint alignment);
229extern int __glXImage3DSize(GLenum format, GLenum type,
230 GLsizei w, GLsizei h, GLsizei d,
231 GLint imageHeight, GLint rowLength,
232 GLint skipImages, GLint skipRows, GLint alignment);
233
234extern int __glXCallListsReqSize(GLbyte * pc, Bool swap);
235extern int __glXBitmapReqSize(GLbyte * pc, Bool swap);
236extern int __glXFogfvReqSize(GLbyte * pc, Bool swap);
237extern int __glXFogivReqSize(GLbyte * pc, Bool swap);
238extern int __glXLightfvReqSize(GLbyte * pc, Bool swap);
239extern int __glXLightivReqSize(GLbyte * pc, Bool swap);
240extern int __glXLightModelfvReqSize(GLbyte * pc, Bool swap);
241extern int __glXLightModelivReqSize(GLbyte * pc, Bool swap);
242extern int __glXMaterialfvReqSize(GLbyte * pc, Bool swap);
243extern int __glXMaterialivReqSize(GLbyte * pc, Bool swap);
244extern int __glXTexParameterfvReqSize(GLbyte * pc, Bool swap);
245extern int __glXTexParameterivReqSize(GLbyte * pc, Bool swap);
246extern int __glXTexImage1DReqSize(GLbyte * pc, Bool swap);
247extern int __glXTexImage2DReqSize(GLbyte * pc, Bool swap);
248extern int __glXTexEnvfvReqSize(GLbyte * pc, Bool swap);
249extern int __glXTexEnvivReqSize(GLbyte * pc, Bool swap);
250extern int __glXTexGendvReqSize(GLbyte * pc, Bool swap);
251extern int __glXTexGenfvReqSize(GLbyte * pc, Bool swap);
252extern int __glXTexGenivReqSize(GLbyte * pc, Bool swap);
253extern int __glXMap1dReqSize(GLbyte * pc, Bool swap);
254extern int __glXMap1fReqSize(GLbyte * pc, Bool swap);
255extern int __glXMap2dReqSize(GLbyte * pc, Bool swap);
256extern int __glXMap2fReqSize(GLbyte * pc, Bool swap);
257extern int __glXPixelMapfvReqSize(GLbyte * pc, Bool swap);
258extern int __glXPixelMapuivReqSize(GLbyte * pc, Bool swap);
259extern int __glXPixelMapusvReqSize(GLbyte * pc, Bool swap);
260extern int __glXDrawPixelsReqSize(GLbyte * pc, Bool swap);
261extern int __glXDrawArraysSize(GLbyte * pc, Bool swap);
262extern int __glXPrioritizeTexturesReqSize(GLbyte * pc, Bool swap);
263extern int __glXTexSubImage1DReqSize(GLbyte * pc, Bool swap);
264extern int __glXTexSubImage2DReqSize(GLbyte * pc, Bool swap);
265extern int __glXTexImage3DReqSize(GLbyte * pc, Bool swap);
266extern int __glXTexSubImage3DReqSize(GLbyte * pc, Bool swap);
267extern int __glXConvolutionFilter1DReqSize(GLbyte * pc, Bool swap);
268extern int __glXConvolutionFilter2DReqSize(GLbyte * pc, Bool swap);
269extern int __glXConvolutionParameterivReqSize(GLbyte * pc, Bool swap);
270extern int __glXConvolutionParameterfvReqSize(GLbyte * pc, Bool swap);
271extern int __glXSeparableFilter2DReqSize(GLbyte * pc, Bool swap);
272extern int __glXColorTableReqSize(GLbyte * pc, Bool swap);
273extern int __glXColorSubTableReqSize(GLbyte * pc, Bool swap);
274extern int __glXColorTableParameterfvReqSize(GLbyte * pc, Bool swap);
275extern int __glXColorTableParameterivReqSize(GLbyte * pc, Bool swap);
276
277/*
278 * Routines for computing the size of returned data.
279 */
280extern int __glXConvolutionParameterivSize(GLenum pname);
281extern int __glXConvolutionParameterfvSize(GLenum pname);
282extern int __glXColorTableParameterfvSize(GLenum pname);
283extern int __glXColorTableParameterivSize(GLenum pname);
284
285extern int __glXVersionMajor;
286extern int __glXVersionMinor;
287
288#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
289 ( (__glXVersionMajor > (major)) || \
290 ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
291
292#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