glxscreens.h revision c2166491
1#ifdef HAVE_DIX_CONFIG_H
2#include <dix-config.h>
3#endif
4
5#ifndef _GLX_screens_h_
6#define _GLX_screens_h_
7
8/*
9 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
10 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice including the dates of first publication and
20 * either this permission notice or a reference to
21 * http://oss.sgi.com/projects/FreeB/
22 * shall be included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
29 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 *
32 * Except as contained in this notice, the name of Silicon Graphics, Inc.
33 * shall not be used in advertising or otherwise to promote the sale, use or
34 * other dealings in this Software without prior written authorization from
35 * Silicon Graphics, Inc.
36 */
37
38#include "extension_string.h"
39#include "glxvndabi.h"
40
41typedef struct __GLXconfig __GLXconfig;
42struct __GLXconfig {
43    /* Management */
44    __GLXconfig *next;
45#ifdef COMPOSITE
46    GLboolean duplicatedForComp;
47#endif
48    GLuint doubleBufferMode;
49    GLuint stereoMode;
50
51    GLint redBits, greenBits, blueBits, alphaBits;      /* bits per comp */
52    GLuint redMask, greenMask, blueMask, alphaMask;
53    GLint rgbBits;              /* total bits for rgb */
54    GLint indexBits;            /* total bits for colorindex */
55
56    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
57    GLint depthBits;
58    GLint stencilBits;
59
60    GLint numAuxBuffers;
61
62    GLint level;
63
64    /* GLX */
65    GLint visualID;
66    GLint visualType;     /**< One of the GLX X visual types. (i.e.,
67			   * \c GLX_TRUE_COLOR, etc.)
68			   */
69
70    /* EXT_visual_rating / GLX 1.2 */
71    GLint visualRating;
72
73    /* EXT_visual_info / GLX 1.2 */
74    GLint transparentPixel;
75    /*    colors are floats scaled to ints */
76    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
77    GLint transparentIndex;
78
79    /* ARB_multisample / SGIS_multisample */
80    GLint sampleBuffers;
81    GLint samples;
82
83    /* SGIX_fbconfig / GLX 1.3 */
84    GLint drawableType;
85    GLint renderType;
86    GLint fbconfigID;
87
88    /* SGIX_pbuffer / GLX 1.3 */
89    GLint maxPbufferWidth;
90    GLint maxPbufferHeight;
91    GLint maxPbufferPixels;
92    GLint optimalPbufferWidth;  /* Only for SGIX_pbuffer. */
93    GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
94
95    /* SGIX_visual_select_group */
96    GLint visualSelectGroup;
97
98    /* OML_swap_method */
99    GLint swapMethod;
100
101    /* EXT_texture_from_pixmap */
102    GLint bindToTextureRgb;
103    GLint bindToTextureRgba;
104    GLint bindToMipmapTexture;
105    GLint bindToTextureTargets;
106    GLint yInverted;
107
108    /* ARB_framebuffer_sRGB */
109    GLint sRGBCapable;
110};
111
112GLint glxConvertToXVisualType(int visualType);
113
114/*
115** Screen dependent data.  These methods are the interface between the DIX
116** and DDX layers of the GLX server extension.  The methods provide an
117** interface for context management on a screen.
118*/
119#ifndef __GLXscreen
120#define __GLXscreen __GLXscreen
121typedef struct __GLXscreen __GLXscreen;
122#endif
123struct __GLXscreen {
124    void (*destroy) (__GLXscreen * screen);
125
126    __GLXcontext *(*createContext) (__GLXscreen * screen,
127                                    __GLXconfig * modes,
128                                    __GLXcontext * shareContext,
129                                    unsigned num_attribs,
130                                    const uint32_t *attribs,
131                                    int *error);
132
133    __GLXdrawable *(*createDrawable) (ClientPtr client,
134                                      __GLXscreen * context,
135                                      DrawablePtr pDraw,
136                                      XID drawId,
137                                      int type,
138                                      XID glxDrawId, __GLXconfig * modes);
139    int (*swapInterval) (__GLXdrawable * drawable, int interval);
140
141    ScreenPtr pScreen;
142
143    /* Linked list of valid fbconfigs for this screen. */
144    __GLXconfig *fbconfigs;
145    int numFBConfigs;
146
147    /* Subset of fbconfigs that are exposed as GLX visuals. */
148    __GLXconfig **visuals;
149    GLint numVisuals;
150
151    char *GLextensions;
152    char *GLXextensions;
153    char *glvnd;
154    unsigned char glx_enable_bits[__GLX_EXT_BYTES];
155
156    Bool (*CloseScreen) (ScreenPtr pScreen);
157};
158
159void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
160void __glXScreenDestroy(__GLXscreen * screen);
161
162#endif                          /* !__GLX_screens_h__ */
163