b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86: xc/programs/Xserver/GL/glx/glxdrawable.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifndef _GLX_drawable_h_
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define _GLX_drawable_h_
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** License Applicability. Except to the extent portions of this file are
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** made subject to an alternative license as permitted in the SGI Free
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Software License B, Version 1.1 (the "License"), the contents of this
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** file are subject only to the provisions of the License. You may not use
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** this file except in compliance with the License. You may obtain a copy
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync**
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** http://oss.sgi.com/projects/FreeB
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync**
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Note that, as provided in the License, the Software is distributed on an
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync**
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Original Code. The Original Code is: OpenGL Sample Implementation,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Copyright in any portions created by third parties is as indicated
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** elsewhere herein. All Rights Reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync**
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Additional Notice Provisions: The application programming interfaces
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** established by SGI in conjunction with the Original Code are The
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** Window System(R) (Version 1.3), released October 19, 1998. This software
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** was created using the OpenGL(R) version 1.2.1 Sample Implementation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** published by SGI, but has not been independently verified as being
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync** compliant with the OpenGL(R) version 1.2.1 Specification.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync**
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DrawablePtr pDraw;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXvisualConfig *pGlxVisual;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXscreenInfo *pGlxScreen;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXFBConfig *pFBConfig;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr pScreen;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool idExists;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int refcnt;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XID *be_xids;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} __GLXpixmap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncstruct __GLXdrawablePrivateRec {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** list of drawable private structs
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync struct __GLXdrawablePrivateRec *last;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync struct __GLXdrawablePrivateRec *next;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DrawablePtr pDraw;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XID drawId;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXpixmap *pGlxPixmap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** Needed by the resource freer because pDraw might already have been
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** freed.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int type;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** Configuration of the visual to which this drawable was created.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXvisualConfig *pGlxVisual;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** cached drawable size and origin
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync GLint xorigin, yorigin;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync GLint width, height;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** list of contexts bound to this drawable
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync struct __GLXcontextRec *glxc;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** "methods" that the drawble should be able to respond to.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync void (*updatePalette)(struct __GLXdrawablePrivateRec *);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** The GL drawable (information shared between GLX and the GL core)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLdrawablePrivate glPriv;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ** reference count
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int refCount;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync};
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DrawablePtr pDraw;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int type;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool idExists;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int refcnt; /* contexts bound */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXFBConfig *pGlxFBConfig;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr pScreen;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} __glXWindow;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXscreenInfo *pGlxScreen;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync __GLXFBConfig *pFBConfig;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr pScreen;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool idExists;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int refcnt;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XID *be_xids;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} __glXPbuffer;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif /* !__GLX_drawable_h__ */