First import
[xorg_rtime.git] / xorg-server-1.4 / GL / glx / glxcontext.h
blobeb10ee2a87deb3f14ce40d46c0288c63484b9622
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 ** 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.
43 #include "GL/internal/glcore.h"
45 typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
46 struct __GLXtextureFromPixmap {
47 int (*bindTexImage) (__GLXcontext *baseContext,
48 int buffer,
49 __GLXpixmap *pixmap);
50 int (*releaseTexImage) (__GLXcontext *baseContext,
51 int buffer,
52 __GLXpixmap *pixmap);
56 struct __GLXcontext {
57 void (*destroy) (__GLXcontext *context);
58 int (*makeCurrent) (__GLXcontext *context);
59 int (*loseCurrent) (__GLXcontext *context);
60 int (*copy) (__GLXcontext *dst,
61 __GLXcontext *src,
62 unsigned long mask);
63 int (*forceCurrent) (__GLXcontext *context);
65 __GLXtextureFromPixmap *textureFromPixmap;
68 ** list of context structs
70 __GLXcontext *last;
71 __GLXcontext *next;
74 ** list of contexts bound to the same drawable
76 __GLXcontext *nextDrawPriv;
77 __GLXcontext *nextReadPriv;
80 ** mode struct for this context
82 __GLcontextModes *modes;
85 ** Pointer to screen info data for this context. This is set
86 ** when the context is created.
88 ScreenPtr pScreen;
89 __GLXscreen *pGlxScreen;
92 ** This context is created with respect to this visual.
94 VisualRec *pVisual;
97 ** The XID of this context.
99 XID id;
102 ** The XID of the shareList context.
104 XID share_id;
107 ** Visual id.
109 VisualID vid;
112 ** screen number.
114 GLint screen;
117 ** Whether this context's ID still exists.
119 GLboolean idExists;
122 ** Whether this context is current for some client.
124 GLboolean isCurrent;
127 ** Whether this context is a direct rendering context.
129 GLboolean isDirect;
132 ** Window pending state
134 GLuint pendingState;
137 ** This flag keeps track of whether there are unflushed GL commands.
139 GLboolean hasUnflushedCommands;
142 ** Current rendering mode for this context.
144 GLenum renderMode;
147 ** Buffers for feedback and selection.
149 GLfloat *feedbackBuf;
150 GLint feedbackBufSize; /* number of elements allocated */
151 GLuint *selectBuf;
152 GLint selectBufSize; /* number of elements allocated */
155 ** Set only if current drawable is a glx pixmap.
157 __GLXpixmap *drawPixmap;
158 __GLXpixmap *readPixmap;
161 ** The drawable private this context is bound to
163 __GLXdrawable *drawPriv;
164 __GLXdrawable *readPriv;
167 /* pending state defines */
168 #define __GLX_PENDING_RESIZE 0x1
169 #define __GLX_PENDING_DESTROY 0x2
170 #define __GLX_PENDING_SWAP 0x4
172 void __glXContextDestroy(__GLXcontext *context);
174 #endif /* !__GLX_context_h__ */