1 | #ifdef HAVE_DIX_CONFIG_H
|
---|
2 | #include <dix-config.h>
|
---|
3 | #endif
|
---|
4 |
|
---|
5 | #ifndef _GLX_context_h_
|
---|
6 | #define _GLX_context_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 | /* XXX: should be defined somewhere globally */
|
---|
44 | #define CAPI
|
---|
45 |
|
---|
46 | #include "GL/internal/glcore.h"
|
---|
47 |
|
---|
48 | typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
|
---|
49 | struct __GLXtextureFromPixmap {
|
---|
50 | int (*bindTexImage) (__GLXcontext *baseContext,
|
---|
51 | int buffer,
|
---|
52 | __GLXpixmap *pixmap);
|
---|
53 | int (*releaseTexImage) (__GLXcontext *baseContext,
|
---|
54 | int buffer,
|
---|
55 | __GLXpixmap *pixmap);
|
---|
56 | };
|
---|
57 |
|
---|
58 |
|
---|
59 | struct __GLXcontext {
|
---|
60 | void (*destroy) (__GLXcontext *context);
|
---|
61 | int (*makeCurrent) (__GLXcontext *context);
|
---|
62 | int (*loseCurrent) (__GLXcontext *context);
|
---|
63 | int (*copy) (__GLXcontext *dst,
|
---|
64 | __GLXcontext *src,
|
---|
65 | unsigned long mask);
|
---|
66 | int (*forceCurrent) (__GLXcontext *context);
|
---|
67 |
|
---|
68 | __GLXtextureFromPixmap *textureFromPixmap;
|
---|
69 |
|
---|
70 | /*
|
---|
71 | ** list of context structs
|
---|
72 | */
|
---|
73 | __GLXcontext *last;
|
---|
74 | __GLXcontext *next;
|
---|
75 |
|
---|
76 | /*
|
---|
77 | ** list of contexts bound to the same drawable
|
---|
78 | */
|
---|
79 | __GLXcontext *nextDrawPriv;
|
---|
80 | __GLXcontext *nextReadPriv;
|
---|
81 |
|
---|
82 | /*
|
---|
83 | ** mode struct for this context
|
---|
84 | */
|
---|
85 | __GLcontextModes *modes;
|
---|
86 |
|
---|
87 | /*
|
---|
88 | ** Pointer to screen info data for this context. This is set
|
---|
89 | ** when the context is created.
|
---|
90 | */
|
---|
91 | ScreenPtr pScreen;
|
---|
92 | __GLXscreen *pGlxScreen;
|
---|
93 |
|
---|
94 | /*
|
---|
95 | ** This context is created with respect to this visual.
|
---|
96 | */
|
---|
97 | VisualRec *pVisual;
|
---|
98 |
|
---|
99 | /*
|
---|
100 | ** The XID of this context.
|
---|
101 | */
|
---|
102 | XID id;
|
---|
103 |
|
---|
104 | /*
|
---|
105 | ** The XID of the shareList context.
|
---|
106 | */
|
---|
107 | XID share_id;
|
---|
108 |
|
---|
109 | /*
|
---|
110 | ** Visual id.
|
---|
111 | */
|
---|
112 | VisualID vid;
|
---|
113 |
|
---|
114 | /*
|
---|
115 | ** screen number.
|
---|
116 | */
|
---|
117 | GLint screen;
|
---|
118 |
|
---|
119 | /*
|
---|
120 | ** Whether this context's ID still exists.
|
---|
121 | */
|
---|
122 | GLboolean idExists;
|
---|
123 |
|
---|
124 | /*
|
---|
125 | ** Whether this context is current for some client.
|
---|
126 | */
|
---|
127 | GLboolean isCurrent;
|
---|
128 |
|
---|
129 | /*
|
---|
130 | ** Whether this context is a direct rendering context.
|
---|
131 | */
|
---|
132 | GLboolean isDirect;
|
---|
133 |
|
---|
134 | /*
|
---|
135 | ** Window pending state
|
---|
136 | */
|
---|
137 | GLuint pendingState;
|
---|
138 |
|
---|
139 | /*
|
---|
140 | ** This flag keeps track of whether there are unflushed GL commands.
|
---|
141 | */
|
---|
142 | GLboolean hasUnflushedCommands;
|
---|
143 |
|
---|
144 | /*
|
---|
145 | ** Current rendering mode for this context.
|
---|
146 | */
|
---|
147 | GLenum renderMode;
|
---|
148 |
|
---|
149 | /*
|
---|
150 | ** Buffers for feedback and selection.
|
---|
151 | */
|
---|
152 | GLfloat *feedbackBuf;
|
---|
153 | GLint feedbackBufSize; /* number of elements allocated */
|
---|
154 | GLuint *selectBuf;
|
---|
155 | GLint selectBufSize; /* number of elements allocated */
|
---|
156 |
|
---|
157 | /*
|
---|
158 | ** Set only if current drawable is a glx pixmap.
|
---|
159 | */
|
---|
160 | __GLXpixmap *drawPixmap;
|
---|
161 | __GLXpixmap *readPixmap;
|
---|
162 |
|
---|
163 | /*
|
---|
164 | ** The drawable private this context is bound to
|
---|
165 | */
|
---|
166 | __GLXdrawable *drawPriv;
|
---|
167 | __GLXdrawable *readPriv;
|
---|
168 | };
|
---|
169 |
|
---|
170 | /* pending state defines */
|
---|
171 | #define __GLX_PENDING_RESIZE 0x1
|
---|
172 | #define __GLX_PENDING_DESTROY 0x2
|
---|
173 | #define __GLX_PENDING_SWAP 0x4
|
---|
174 |
|
---|
175 | void __glXContextDestroy(__GLXcontext *context);
|
---|
176 |
|
---|
177 | #endif /* !__GLX_context_h__ */
|
---|