VirtualBox

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

Last change on this file since 78293 was 43272, checked in by vboxsync, 12 years ago

Additions/x11: more original X server headers.

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