1 #ifdef HAVE_DIX_CONFIG_H
2 #include <dix-config.h>
3 #endif
5 #ifndef _GLX_context_h_
6 #define _GLX_context_h_
8 /*
9 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
10 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice including the dates of first publication and
20 * either this permission notice or a reference to
21 * http://oss.sgi.com/projects/FreeB/
22 * shall be included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
29 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 *
32 * Except as contained in this notice, the name of Silicon Graphics, Inc.
33 * shall not be used in advertising or otherwise to promote the sale, use or
34 * other dealings in this Software without prior written authorization from
35 * Silicon Graphics, Inc.
36 */
38 typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
39 struct __GLXtextureFromPixmap {
40 int (*bindTexImage) (__GLXcontext *baseContext,
41 int buffer,
42 __GLXdrawable *pixmap);
43 int (*releaseTexImage) (__GLXcontext *baseContext,
44 int buffer,
45 __GLXdrawable *pixmap);
46 };
49 struct __GLXcontext {
50 void (*destroy) (__GLXcontext *context);
51 int (*makeCurrent) (__GLXcontext *context);
52 int (*loseCurrent) (__GLXcontext *context);
53 int (*copy) (__GLXcontext *dst,
54 __GLXcontext *src,
55 unsigned long mask);
56 Bool (*wait) (__GLXcontext *context,
57 __GLXclientState *cl,
58 int *error);
60 __GLXtextureFromPixmap *textureFromPixmap;
62 /*
63 ** list of context structs
64 */
65 __GLXcontext *last;
66 __GLXcontext *next;
68 /*
69 ** config struct for this context
70 */
71 __GLXconfig *config;
73 /*
74 ** Pointer to screen info data for this context. This is set
75 ** when the context is created.
76 */
77 __GLXscreen *pGlxScreen;
79 /*
80 ** The XID of this context.
81 */
82 XID id;
84 /*
85 ** The XID of the shareList context.
86 */
87 XID share_id;
89 /*
90 ** Whether this context's ID still exists.
91 */
92 GLboolean idExists;
94 /*
95 ** Whether this context is current for some client.
96 */
97 GLboolean isCurrent;
99 /*
100 ** Whether this context is a direct rendering context.
101 */
102 GLboolean isDirect;
104 /*
105 ** This flag keeps track of whether there are unflushed GL commands.
106 */
107 GLboolean hasUnflushedCommands;
109 /*
110 ** Current rendering mode for this context.
111 */
112 GLenum renderMode;
114 /*
115 ** Buffers for feedback and selection.
116 */
117 GLfloat *feedbackBuf;
118 GLint feedbackBufSize; /* number of elements allocated */
119 GLuint *selectBuf;
120 GLint selectBufSize; /* number of elements allocated */
122 /*
123 ** The drawable private this context is bound to
124 */
125 __GLXdrawable *drawPriv;
126 __GLXdrawable *readPriv;
127 };
129 void __glXContextDestroy(__GLXcontext *context);
131 #endif /* !__GLX_context_h__ */