glxscreens.h revision 35c4bbdf
14642e01fSmrg#ifdef HAVE_DIX_CONFIG_H
24642e01fSmrg#include <dix-config.h>
34642e01fSmrg#endif
44642e01fSmrg
54642e01fSmrg#ifndef _GLX_screens_h_
64642e01fSmrg#define _GLX_screens_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 __GLXconfig __GLXconfig;
394642e01fSmrgstruct __GLXconfig {
404642e01fSmrg    __GLXconfig *next;
414642e01fSmrg    GLuint doubleBufferMode;
424642e01fSmrg    GLuint stereoMode;
434642e01fSmrg
4435c4bbdfSmrg    GLint redBits, greenBits, blueBits, alphaBits;      /* bits per comp */
454642e01fSmrg    GLuint redMask, greenMask, blueMask, alphaMask;
4635c4bbdfSmrg    GLint rgbBits;              /* total bits for rgb */
4735c4bbdfSmrg    GLint indexBits;            /* total bits for colorindex */
484642e01fSmrg
494642e01fSmrg    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
504642e01fSmrg    GLint depthBits;
514642e01fSmrg    GLint stencilBits;
524642e01fSmrg
534642e01fSmrg    GLint numAuxBuffers;
544642e01fSmrg
554642e01fSmrg    GLint level;
564642e01fSmrg
574642e01fSmrg    /* GLX */
584642e01fSmrg    GLint visualID;
5935c4bbdfSmrg    GLint visualType;     /**< One of the GLX X visual types. (i.e.,
604642e01fSmrg			   * \c GLX_TRUE_COLOR, etc.)
614642e01fSmrg			   */
624642e01fSmrg
634642e01fSmrg    /* EXT_visual_rating / GLX 1.2 */
644642e01fSmrg    GLint visualRating;
654642e01fSmrg
664642e01fSmrg    /* EXT_visual_info / GLX 1.2 */
674642e01fSmrg    GLint transparentPixel;
6835c4bbdfSmrg    /*    colors are floats scaled to ints */
694642e01fSmrg    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
704642e01fSmrg    GLint transparentIndex;
714642e01fSmrg
724642e01fSmrg    /* ARB_multisample / SGIS_multisample */
734642e01fSmrg    GLint sampleBuffers;
744642e01fSmrg    GLint samples;
754642e01fSmrg
764642e01fSmrg    /* SGIX_fbconfig / GLX 1.3 */
774642e01fSmrg    GLint drawableType;
784642e01fSmrg    GLint renderType;
794642e01fSmrg    GLint xRenderable;
804642e01fSmrg    GLint fbconfigID;
814642e01fSmrg
824642e01fSmrg    /* SGIX_pbuffer / GLX 1.3 */
834642e01fSmrg    GLint maxPbufferWidth;
844642e01fSmrg    GLint maxPbufferHeight;
854642e01fSmrg    GLint maxPbufferPixels;
8635c4bbdfSmrg    GLint optimalPbufferWidth;  /* Only for SGIX_pbuffer. */
8735c4bbdfSmrg    GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
884642e01fSmrg
894642e01fSmrg    /* SGIX_visual_select_group */
904642e01fSmrg    GLint visualSelectGroup;
914642e01fSmrg
924642e01fSmrg    /* OML_swap_method */
934642e01fSmrg    GLint swapMethod;
944642e01fSmrg
954642e01fSmrg    /* EXT_texture_from_pixmap */
964642e01fSmrg    GLint bindToTextureRgb;
974642e01fSmrg    GLint bindToTextureRgba;
984642e01fSmrg    GLint bindToMipmapTexture;
994642e01fSmrg    GLint bindToTextureTargets;
1004642e01fSmrg    GLint yInverted;
10135c4bbdfSmrg
10235c4bbdfSmrg    /* ARB_framebuffer_sRGB */
10335c4bbdfSmrg    GLint sRGBCapable;
1044642e01fSmrg};
1054642e01fSmrg
1064642e01fSmrgGLint glxConvertToXVisualType(int visualType);
1074642e01fSmrg
1084642e01fSmrg/*
1094642e01fSmrg** Screen dependent data.  These methods are the interface between the DIX
1104642e01fSmrg** and DDX layers of the GLX server extension.  The methods provide an
1114642e01fSmrg** interface for context management on a screen.
1124642e01fSmrg*/
1134642e01fSmrgtypedef struct __GLXscreen __GLXscreen;
1144642e01fSmrgstruct __GLXscreen {
11535c4bbdfSmrg    void (*destroy) (__GLXscreen * screen);
11635c4bbdfSmrg
11735c4bbdfSmrg    __GLXcontext *(*createContext) (__GLXscreen * screen,
11835c4bbdfSmrg                                    __GLXconfig * modes,
11935c4bbdfSmrg                                    __GLXcontext * shareContext,
12035c4bbdfSmrg                                    unsigned num_attribs,
12135c4bbdfSmrg                                    const uint32_t *attribs,
12235c4bbdfSmrg                                    int *error);
12335c4bbdfSmrg
12435c4bbdfSmrg    __GLXdrawable *(*createDrawable) (ClientPtr client,
12535c4bbdfSmrg                                      __GLXscreen * context,
12635c4bbdfSmrg                                      DrawablePtr pDraw,
12735c4bbdfSmrg                                      XID drawId,
12835c4bbdfSmrg                                      int type,
12935c4bbdfSmrg                                      XID glxDrawId, __GLXconfig * modes);
13035c4bbdfSmrg    int (*swapInterval) (__GLXdrawable * drawable, int interval);
1314642e01fSmrg
1324642e01fSmrg    ScreenPtr pScreen;
1334642e01fSmrg
1344642e01fSmrg    /* Linked list of valid fbconfigs for this screen. */
1354642e01fSmrg    __GLXconfig *fbconfigs;
1364642e01fSmrg    int numFBConfigs;
1374642e01fSmrg
1384642e01fSmrg    /* Subset of fbconfigs that are exposed as GLX visuals. */
1394642e01fSmrg    __GLXconfig **visuals;
1404642e01fSmrg    GLint numVisuals;
1414642e01fSmrg
1424642e01fSmrg    char *GLextensions;
1434642e01fSmrg
1444642e01fSmrg    char *GLXextensions;
1454642e01fSmrg
1466747b715Smrg    /**
1476747b715Smrg     * \name GLX version supported by this screen.
1486747b715Smrg     *
1496747b715Smrg     * Since the GLX version advertised by the server is for the whole server,
1506747b715Smrg     * the GLX protocol code uses the minimum version supported on all screens.
1516747b715Smrg     */
15235c4bbdfSmrg    /*@{ */
1536747b715Smrg    unsigned GLXmajor;
1546747b715Smrg    unsigned GLXminor;
15535c4bbdfSmrg    /*@} */
1566747b715Smrg
15735c4bbdfSmrg    Bool (*CloseScreen) (ScreenPtr pScreen);
1584642e01fSmrg};
1594642e01fSmrg
16035c4bbdfSmrgvoid __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
16135c4bbdfSmrgvoid __glXScreenDestroy(__GLXscreen * screen);
1624642e01fSmrg
16335c4bbdfSmrg#endif                          /* !__GLX_screens_h__ */
164