VirtualBox

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

Last change on this file since 32915 was 17471, checked in by vboxsync, 16 years ago

export to OSE

  • Property svn:eol-style set to native
File size: 7.6 KB
Line 
1#ifdef HAVE_DIX_CONFIG_H
2#include <dix-config.h>
3#endif
4
5#ifndef _GLX_server_h_
6#define _GLX_server_h_
7
8/*
9** License Applicability. Except to the extent portions of this file are
10** made subject to an alternative license as permitted in the SGI Free
11** Software License B, Version 1.1 (the "License"), the contents of this
12** file are subject only to the provisions of the License. You may not use
13** this file except in compliance with the License. You may obtain a copy
14** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
15** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
16**
17** http://oss.sgi.com/projects/FreeB
18**
19** Note that, as provided in the License, the Software is distributed on an
20** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
21** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
22** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
23** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
24**
25** Original Code. The Original Code is: OpenGL Sample Implementation,
26** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
27** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
28** Copyright in any portions created by third parties is as indicated
29** elsewhere herein. All Rights Reserved.
30**
31** Additional Notice Provisions: The application programming interfaces
32** established by SGI in conjunction with the Original Code are The
33** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
34** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
35** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
36** Window System(R) (Version 1.3), released October 19, 1998. This software
37** was created using the OpenGL(R) version 1.2.1 Sample Implementation
38** published by SGI, but has not been independently verified as being
39** compliant with the OpenGL(R) version 1.2.1 Specification.
40**
41*/
42
43#include <X11/X.h>
44#include <X11/Xproto.h>
45#include <X11/Xmd.h>
46#include <misc.h>
47#include <dixstruct.h>
48#include <pixmapstr.h>
49#include <gcstruct.h>
50#include <extnsionst.h>
51#include <resource.h>
52#include <scrnintstr.h>
53
54/*
55** The X header misc.h defines these math functions.
56*/
57#undef abs
58#undef fabs
59
60#define GL_GLEXT_PROTOTYPES /* we want prototypes */
61#include <GL/gl.h>
62#include <GL/glxproto.h>
63#include <GL/glxint.h>
64
65/* For glxscreens.h */
66typedef struct __GLXdrawable __GLXdrawable;
67typedef struct __GLXcontext __GLXcontext;
68
69#include "glxscreens.h"
70#include "glxdrawable.h"
71#include "glxcontext.h"
72
73
74#define GLX_SERVER_MAJOR_VERSION 1
75#define GLX_SERVER_MINOR_VERSION 2
76
77#ifndef True
78#define True 1
79#endif
80#ifndef False
81#define False 0
82#endif
83
84/*
85** GLX resources.
86*/
87typedef XID GLXContextID;
88typedef XID GLXPixmap;
89typedef XID GLXDrawable;
90
91typedef struct __GLXclientStateRec __GLXclientState;
92
93extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
94extern __GLXclientState *glxGetClient(ClientPtr pClient);
95
96/************************************************************************/
97
98void GlxExtensionInit(void);
99
100void GlxSetVisualConfigs(int nconfigs,
101 __GLXvisualConfig *configs, void **privates);
102
103struct _glapi_table;
104void GlxSetRenderTables (struct _glapi_table *table);
105
106void __glXScreenInitVisuals(__GLXscreen *screen);
107
108/*
109** The last context used (from the server's persective) is cached.
110*/
111extern __GLXcontext *__glXLastContext;
112extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
113
114extern ClientPtr __pGlxClient;
115
116int __glXError(int error);
117
118/*
119** Macros to set, unset, and retrieve the flag that says whether a context
120** has unflushed commands.
121*/
122#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
123#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
124#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
125
126/************************************************************************/
127
128typedef struct __GLXprovider __GLXprovider;
129struct __GLXprovider {
130 __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
131 const char *name;
132 __GLXprovider *next;
133};
134
135void GlxPushProvider(__GLXprovider *provider);
136
137enum {
138 GLX_MINIMAL_VISUALS,
139 GLX_TYPICAL_VISUALS,
140 GLX_ALL_VISUALS
141};
142
143void GlxSetVisualConfig(int config);
144
145void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
146 void (*leave)(GLboolean));
147void __glXenterServer(GLboolean rendering);
148void __glXleaveServer(GLboolean rendering);
149
150void glxSuspendClients(void);
151void glxResumeClients(void);
152
153/*
154** State kept per client.
155*/
156struct __GLXclientStateRec {
157 /*
158 ** Whether this structure is currently being used to support a client.
159 */
160 Bool inUse;
161
162 /*
163 ** Buffer for returned data.
164 */
165 GLbyte *returnBuf;
166 GLint returnBufSize;
167
168 /*
169 ** Keep track of large rendering commands, which span multiple requests.
170 */
171 GLint largeCmdBytesSoFar; /* bytes received so far */
172 GLint largeCmdBytesTotal; /* total bytes expected */
173 GLint largeCmdRequestsSoFar; /* requests received so far */
174 GLint largeCmdRequestsTotal; /* total requests expected */
175 GLbyte *largeCmdBuf;
176 GLint largeCmdBufSize;
177
178 /*
179 ** Keep a list of all the contexts that are current for this client's
180 ** threads.
181 */
182 __GLXcontext **currentContexts;
183 GLint numCurrentContexts;
184
185 /* Back pointer to X client record */
186 ClientPtr client;
187
188 int GLClientmajorVersion;
189 int GLClientminorVersion;
190 char *GLClientextensions;
191};
192
193/************************************************************************/
194
195/*
196** Dispatch tables.
197*/
198typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
199typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
200typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
201
202/*
203 * Dispatch for GLX commands.
204 */
205typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
206
207/*
208 * Tables for computing the size of each rendering command.
209 */
210typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
211
212typedef struct {
213 int bytes;
214 gl_proto_size_func varsize;
215} __GLXrenderSizeData;
216
217/************************************************************************/
218
219/*
220** X resources.
221*/
222extern RESTYPE __glXContextRes;
223extern RESTYPE __glXClientRes;
224extern RESTYPE __glXPixmapRes;
225extern RESTYPE __glXDrawableRes;
226
227/************************************************************************/
228
229/*
230** Prototypes.
231*/
232
233extern char *__glXcombine_strings(const char *, const char *);
234
235/*
236** Routines for sending swapped replies.
237*/
238
239extern void __glXSwapMakeCurrentReply(ClientPtr client,
240 xGLXMakeCurrentReply *reply);
241extern void __glXSwapIsDirectReply(ClientPtr client,
242 xGLXIsDirectReply *reply);
243extern void __glXSwapQueryVersionReply(ClientPtr client,
244 xGLXQueryVersionReply *reply);
245extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
246 xGLXQueryContextInfoEXTReply *reply,
247 int *buf);
248extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
249 xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
250extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
251 xGLXQueryExtensionsStringReply *reply, char *buf);
252extern void glxSwapQueryServerStringReply(ClientPtr client,
253 xGLXQueryServerStringReply *reply, char *buf);
254
255
256/*
257 * Routines for computing the size of variably-sized rendering commands.
258 */
259
260extern int __glXTypeSize(GLenum enm);
261extern int __glXImageSize(GLenum format, GLenum type,
262 GLenum target, GLsizei w, GLsizei h, GLsizei d,
263 GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
264 GLint alignment);
265
266#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