glxcontext.h revision 4642e01f
14642e01fSmrg#ifdef HAVE_DIX_CONFIG_H
24642e01fSmrg#include <dix-config.h>
34642e01fSmrg#endif
44642e01fSmrg
54642e01fSmrg#ifndef _GLX_context_h_
64642e01fSmrg#define _GLX_context_h_
74642e01fSmrg
84642e01fSmrg/*
94642e01fSmrg * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
104642e01fSmrg * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
114642e01fSmrg *
124642e01fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
134642e01fSmrg * copy of this software and associated documentation files (the "Software"),
144642e01fSmrg * to deal in the Software without restriction, including without limitation
154642e01fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
164642e01fSmrg * and/or sell copies of the Software, and to permit persons to whom the
174642e01fSmrg * Software is furnished to do so, subject to the following conditions:
184642e01fSmrg *
194642e01fSmrg * The above copyright notice including the dates of first publication and
204642e01fSmrg * either this permission notice or a reference to
214642e01fSmrg * http://oss.sgi.com/projects/FreeB/
224642e01fSmrg * shall be included in all copies or substantial portions of the Software.
234642e01fSmrg *
244642e01fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
254642e01fSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
264642e01fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
274642e01fSmrg * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
284642e01fSmrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
294642e01fSmrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
304642e01fSmrg * SOFTWARE.
314642e01fSmrg *
324642e01fSmrg * Except as contained in this notice, the name of Silicon Graphics, Inc.
334642e01fSmrg * shall not be used in advertising or otherwise to promote the sale, use or
344642e01fSmrg * other dealings in this Software without prior written authorization from
354642e01fSmrg * Silicon Graphics, Inc.
364642e01fSmrg */
374642e01fSmrg
384642e01fSmrgtypedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
394642e01fSmrgstruct __GLXtextureFromPixmap {
404642e01fSmrg    int (*bindTexImage)		(__GLXcontext  *baseContext,
414642e01fSmrg				 int            buffer,
424642e01fSmrg				 __GLXdrawable *pixmap);
434642e01fSmrg    int (*releaseTexImage)	(__GLXcontext  *baseContext,
444642e01fSmrg				 int            buffer,
454642e01fSmrg				 __GLXdrawable *pixmap);
464642e01fSmrg};
474642e01fSmrg
484642e01fSmrg
494642e01fSmrgstruct __GLXcontext {
504642e01fSmrg    void           (*destroy)       (__GLXcontext *context);
514642e01fSmrg    int            (*makeCurrent)   (__GLXcontext *context);
524642e01fSmrg    int            (*loseCurrent)   (__GLXcontext *context);
534642e01fSmrg    int            (*copy)          (__GLXcontext *dst,
544642e01fSmrg				     __GLXcontext *src,
554642e01fSmrg				     unsigned long mask);
564642e01fSmrg    int            (*forceCurrent)  (__GLXcontext *context);
574642e01fSmrg
584642e01fSmrg    __GLXtextureFromPixmap *textureFromPixmap;
594642e01fSmrg
604642e01fSmrg    /*
614642e01fSmrg    ** list of context structs
624642e01fSmrg    */
634642e01fSmrg    __GLXcontext *last;
644642e01fSmrg    __GLXcontext *next;
654642e01fSmrg
664642e01fSmrg    /*
674642e01fSmrg    ** config struct for this context
684642e01fSmrg    */
694642e01fSmrg    __GLXconfig *config;
704642e01fSmrg
714642e01fSmrg    /*
724642e01fSmrg    ** Pointer to screen info data for this context.  This is set
734642e01fSmrg    ** when the context is created.
744642e01fSmrg    */
754642e01fSmrg    __GLXscreen *pGlxScreen;
764642e01fSmrg
774642e01fSmrg    /*
784642e01fSmrg    ** The XID of this context.
794642e01fSmrg    */
804642e01fSmrg    XID id;
814642e01fSmrg
824642e01fSmrg    /*
834642e01fSmrg    ** The XID of the shareList context.
844642e01fSmrg    */
854642e01fSmrg    XID share_id;
864642e01fSmrg
874642e01fSmrg    /*
884642e01fSmrg    ** Whether this context's ID still exists.
894642e01fSmrg    */
904642e01fSmrg    GLboolean idExists;
914642e01fSmrg
924642e01fSmrg    /*
934642e01fSmrg    ** Whether this context is current for some client.
944642e01fSmrg    */
954642e01fSmrg    GLboolean isCurrent;
964642e01fSmrg
974642e01fSmrg    /*
984642e01fSmrg    ** Whether this context is a direct rendering context.
994642e01fSmrg    */
1004642e01fSmrg    GLboolean isDirect;
1014642e01fSmrg
1024642e01fSmrg    /*
1034642e01fSmrg    ** This flag keeps track of whether there are unflushed GL commands.
1044642e01fSmrg    */
1054642e01fSmrg    GLboolean hasUnflushedCommands;
1064642e01fSmrg
1074642e01fSmrg    /*
1084642e01fSmrg    ** Current rendering mode for this context.
1094642e01fSmrg    */
1104642e01fSmrg    GLenum renderMode;
1114642e01fSmrg
1124642e01fSmrg    /*
1134642e01fSmrg    ** Buffers for feedback and selection.
1144642e01fSmrg    */
1154642e01fSmrg    GLfloat *feedbackBuf;
1164642e01fSmrg    GLint feedbackBufSize;	/* number of elements allocated */
1174642e01fSmrg    GLuint *selectBuf;
1184642e01fSmrg    GLint selectBufSize;	/* number of elements allocated */
1194642e01fSmrg
1204642e01fSmrg    /*
1214642e01fSmrg    ** The drawable private this context is bound to
1224642e01fSmrg    */
1234642e01fSmrg    __GLXdrawable *drawPriv;
1244642e01fSmrg    __GLXdrawable *readPriv;
1254642e01fSmrg};
1264642e01fSmrg
1274642e01fSmrgvoid __glXContextDestroy(__GLXcontext *context);
1284642e01fSmrg
1294642e01fSmrg#endif /* !__GLX_context_h__ */
130