VirtualBox

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

最後變更 在這個檔案從40349是 40349,由 vboxsync 提交於 13 年 前

Additions/xorg: support X.Org Server 1.12.

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

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