VirtualBox

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

最後變更 在這個檔案是 51223,由 vboxsync 提交於 11 年 前

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • 屬性 svn:eol-style 設為 native
檔案大小: 11.3 KB
 
1/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
2#ifndef _GLX_server_h_
3#define _GLX_server_h_
4
5/*
6** License Applicability. Except to the extent portions of this file are
7** made subject to an alternative license as permitted in the SGI Free
8** Software License B, Version 1.1 (the "License"), the contents of this
9** file are subject only to the provisions of the License. You may not use
10** this file except in compliance with the License. You may obtain a copy
11** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
12** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
13**
14** http://oss.sgi.com/projects/FreeB
15**
16** Note that, as provided in the License, the Software is distributed on an
17** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
18** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
19** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
20** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
21**
22** Original Code. The Original Code is: OpenGL Sample Implementation,
23** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
24** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
25** Copyright in any portions created by third parties is as indicated
26** elsewhere herein. All Rights Reserved.
27**
28** Additional Notice Provisions: The application programming interfaces
29** established by SGI in conjunction with the Original Code are The
30** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
31** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
32** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
33** Window System(R) (Version 1.3), released October 19, 1998. This software
34** was created using the OpenGL(R) version 1.2.1 Sample Implementation
35** published by SGI, but has not been independently verified as being
36** compliant with the OpenGL(R) version 1.2.1 Specification.
37**
38*/
39
40#include "dmx.h"
41
42#include <misc.h>
43#include <dixstruct.h>
44#include <pixmapstr.h>
45#include <gcstruct.h>
46#include <extnsionst.h>
47#include <resource.h>
48#include <scrnintstr.h>
49#include "GL/glx_ansic.h"
50
51
52/*
53** The X header misc.h defines these math functions.
54*/
55#undef abs
56#undef fabs
57
58#define GL_GLEXT_PROTOTYPES /* we want prototypes */
59#include <GL/gl.h>
60#include <GL/glxproto.h>
61#include <GL/glxint.h>
62
63/* For glxscreens.h */
64typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
65
66#include "glxscreens.h"
67#include "glxdrawable.h"
68#include "glxcontext.h"
69#include "glxerror.h"
70
71
72#define GLX_SERVER_MAJOR_VERSION 1
73#define GLX_SERVER_MINOR_VERSION 3
74
75#ifndef True
76#define True 1
77#endif
78#ifndef False
79#define False 0
80#endif
81
82/*
83** GLX resources.
84typedef XID GLXContextID;
85typedef XID GLXPixmap;
86typedef XID GLXDrawable;
87typedef XID GLXWindow;
88typedef XID GLXPbuffer;
89
90typedef struct __GLXcontextRec *GLXContext;
91*/
92typedef struct __GLXclientStateRec __GLXclientState;
93
94extern __GLXscreenInfo *__glXActiveScreens;
95extern GLint __glXNumActiveScreens;
96
97/************************************************************************/
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
105/*
106** Macros to set, unset, and retrieve the flag that says whether a context
107** has unflushed commands.
108*/
109#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
110#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
111#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
112
113/************************************************************************/
114
115typedef struct {
116 int elem_size; /* element size in bytes */
117 int nelems; /* number of elements to swap */
118 void (*swapfunc)(GLbyte *pc);
119} __GLXRenderSwapInfo;
120
121/*
122** State kept per client.
123*/
124struct __GLXclientStateRec {
125 /*
126 ** Whether this structure is currently being used to support a client.
127 */
128 Bool inUse;
129
130 /*
131 ** Buffer for returned data.
132 */
133 GLbyte *returnBuf;
134 GLint returnBufSize;
135
136 /*
137 ** Keep a list of all the contexts that are current for this client's
138 ** threads.
139 */
140 __GLXcontext **currentContexts;
141 DrawablePtr *currentDrawables;
142 GLint numCurrentContexts;
143
144 /* Back pointer to X client record */
145 ClientPtr client;
146
147 int GLClientmajorVersion;
148 int GLClientminorVersion;
149 char *GLClientextensions;
150
151 GLXContextTag *be_currentCTag;
152 Display **be_displays;
153
154 /*
155 ** Keep track of large rendering commands, which span multiple requests.
156 */
157 GLint largeCmdBytesSoFar; /* bytes received so far */
158 GLint largeCmdBytesTotal; /* total bytes expected */
159 GLint largeCmdRequestsSoFar; /* requests received so far */
160 GLint largeCmdRequestsTotal; /* total requests expected */
161 void (*largeCmdRequestsSwapProc)(GLbyte *);
162 __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
163 GLbyte *largeCmdBuf;
164 GLint largeCmdBufSize;
165 GLint largeCmdMaxReqDataSize;
166
167};
168
169extern __GLXclientState *__glXClients[];
170
171/************************************************************************/
172
173/*
174** Dispatch tables.
175*/
176typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
177typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
178typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
179extern __GLXdispatchSingleProcPtr __glXSingleTable[];
180extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
181extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
182extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
183extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
184
185extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
186
187/*
188 * Dispatch for GLX commands.
189 */
190typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
191extern __GLXprocPtr __glXProcTable[];
192
193/*
194 * Tables for computing the size of each rendering command.
195 */
196typedef struct {
197 int bytes;
198 int (*varsize)(GLbyte *pc, Bool swap);
199} __GLXrenderSizeData;
200extern __GLXrenderSizeData __glXRenderSizeTable[];
201extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
202
203/************************************************************************/
204
205/*
206** X resources.
207*/
208extern RESTYPE __glXContextRes;
209extern RESTYPE __glXClientRes;
210extern RESTYPE __glXPixmapRes;
211extern RESTYPE __glXDrawableRes;
212extern RESTYPE __glXWindowRes;
213extern RESTYPE __glXPbufferRes;
214
215/************************************************************************/
216
217/*
218** Prototypes.
219*/
220
221
222extern char *__glXcombine_strings(const char *, const char *);
223
224extern void __glXDisp_DrawArrays(GLbyte*);
225extern void __glXDispSwap_DrawArrays(GLbyte*);
226
227
228/*
229** Routines for sending swapped replies.
230*/
231
232extern void __glXSwapMakeCurrentReply(ClientPtr client,
233 xGLXMakeCurrentReadSGIReply *reply);
234
235extern void __glXSwapIsDirectReply(ClientPtr client,
236 xGLXIsDirectReply *reply);
237extern void __glXSwapQueryVersionReply(ClientPtr client,
238 xGLXQueryVersionReply *reply);
239extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
240 xGLXQueryContextInfoEXTReply *reply,
241 int *buf);
242extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
243 xGLXQueryExtensionsStringReply *reply, char *buf);
244extern void glxSwapQueryServerStringReply(ClientPtr client,
245 xGLXQueryServerStringReply *reply, char *buf);
246extern void __glXSwapQueryContextReply(ClientPtr client,
247 xGLXQueryContextReply *reply, int *buf);
248extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
249 xGLXGetDrawableAttributesReply *reply, int *buf);
250extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
251 xGLXQueryMaxSwapBarriersSGIXReply *reply);
252
253/*
254 * Routines for computing the size of variably-sized rendering commands.
255 */
256
257extern int __glXTypeSize(GLenum enm);
258extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
259 GLint rowLength, GLint skipRows, GLint alignment);
260extern int __glXImage3DSize(GLenum format, GLenum type,
261 GLsizei w, GLsizei h, GLsizei d,
262 GLint imageHeight, GLint rowLength,
263 GLint skipImages, GLint skipRows,
264 GLint alignment);
265
266extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
267extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
268extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
269extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
270extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
271extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
272extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
273extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
274extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
275extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
276extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
277extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
278extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
279extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
280extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
281extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
282extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
283extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
284extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
285extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
286extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
287extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
288extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
289extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
290extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
291extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
292extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
293extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
294extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
295extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
296extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
297extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
298extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
299extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
300extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
301extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
302extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
303extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
304extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
305extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
306extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
307extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
308
309/*
310 * Routines for computing the size of returned data.
311 */
312extern int __glXConvolutionParameterivSize(GLenum pname);
313extern int __glXConvolutionParameterfvSize(GLenum pname);
314extern int __glXColorTableParameterfvSize(GLenum pname);
315extern int __glXColorTableParameterivSize(GLenum pname);
316
317extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
318extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer);
319
320extern int __glXVersionMajor;
321extern int __glXVersionMinor;
322
323#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
324 ( (__glXVersionMajor > (major)) || \
325 ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
326
327#endif /* !__GLX_server_h__ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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