65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef HAVE_DIX_CONFIG_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <dix-config.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef _GLX_context_h_
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _GLX_context_h_
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
65fea56f17cd614bc8908264df980a62e1931468vboxsync * copy of this software and associated documentation files (the "Software"),
65fea56f17cd614bc8908264df980a62e1931468vboxsync * to deal in the Software without restriction, including without limitation
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * and/or sell copies of the Software, and to permit persons to whom the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Software is furnished to do so, subject to the following conditions:
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The above copyright notice including the dates of first publication and
65fea56f17cd614bc8908264df980a62e1931468vboxsync * either this permission notice or a reference to
65fea56f17cd614bc8908264df980a62e1931468vboxsync * http://oss.sgi.com/projects/FreeB/
65fea56f17cd614bc8908264df980a62e1931468vboxsync * shall be included in all copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
65fea56f17cd614bc8908264df980a62e1931468vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsync * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
65fea56f17cd614bc8908264df980a62e1931468vboxsync * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65fea56f17cd614bc8908264df980a62e1931468vboxsync * SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Except as contained in this notice, the name of Silicon Graphics, Inc.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * shall not be used in advertising or otherwise to promote the sale, use or
65fea56f17cd614bc8908264df980a62e1931468vboxsync * other dealings in this Software without prior written authorization from
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Silicon Graphics, Inc.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsyncstruct __GLXtextureFromPixmap {
65fea56f17cd614bc8908264df980a62e1931468vboxsync int (*bindTexImage) (__GLXcontext * baseContext,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int buffer, __GLXdrawable * pixmap);
65fea56f17cd614bc8908264df980a62e1931468vboxsync int (*releaseTexImage) (__GLXcontext * baseContext,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int buffer, __GLXdrawable * pixmap);
65fea56f17cd614bc8908264df980a62e1931468vboxsync};
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncstruct __GLXcontext {
65fea56f17cd614bc8908264df980a62e1931468vboxsync void (*destroy) (__GLXcontext * context);
65fea56f17cd614bc8908264df980a62e1931468vboxsync int (*makeCurrent) (__GLXcontext * context);
65fea56f17cd614bc8908264df980a62e1931468vboxsync int (*loseCurrent) (__GLXcontext * context);
65fea56f17cd614bc8908264df980a62e1931468vboxsync int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask);
65fea56f17cd614bc8908264df980a62e1931468vboxsync Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXtextureFromPixmap *textureFromPixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** list of context structs
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXcontext *next;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** config struct for this context
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXconfig *config;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** Pointer to screen info data for this context. This is set
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** when the context is created.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXscreen *pGlxScreen;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** If this context is current for a client, this will be that client
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync ClientPtr currentClient;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** The XID of this context.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID id;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** The XID of the shareList context.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID share_id;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** Whether this context's ID still exists.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLboolean idExists;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** Whether this context is a direct rendering context.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLboolean isDirect;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** This flag keeps track of whether there are unflushed GL commands.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLboolean hasUnflushedCommands;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** Current rendering mode for this context.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLenum renderMode;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /**
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Reset notification strategy used when a GPU reset occurs.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLenum resetNotificationStrategy;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** Buffers for feedback and selection.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLfloat *feedbackBuf;
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLint feedbackBufSize; /* number of elements allocated */
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLuint *selectBuf;
65fea56f17cd614bc8908264df980a62e1931468vboxsync GLint selectBufSize; /* number of elements allocated */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*
65fea56f17cd614bc8908264df980a62e1931468vboxsync ** The drawable private this context is bound to
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXdrawable *drawPriv;
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXdrawable *readPriv;
65fea56f17cd614bc8908264df980a62e1931468vboxsync};
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid __glXContextDestroy(__GLXcontext * context);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int validGlxScreen(ClientPtr client, int screen,
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXscreen ** pGlxScreen, int *err);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID id, __GLXconfig ** config, int *err);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int validGlxContext(ClientPtr client, XID id, int access_mode,
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXcontext ** context, int *err);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern __GLXcontext *__glXdirectContextCreate(__GLXscreen * screen,
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXconfig * modes,
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXcontext * shareContext);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* !__GLX_context_h__ */