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 | typedef struct __GLXconfig __GLXconfig;
|
---|
39 | struct __GLXconfig {
|
---|
40 | __GLXconfig *next;
|
---|
41 | GLuint doubleBufferMode;
|
---|
42 | GLuint stereoMode;
|
---|
43 |
|
---|
44 | GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
|
---|
45 | GLuint redMask, greenMask, blueMask, alphaMask;
|
---|
46 | GLint rgbBits; /* total bits for rgb */
|
---|
47 | GLint indexBits; /* total bits for colorindex */
|
---|
48 |
|
---|
49 | GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
|
---|
50 | GLint depthBits;
|
---|
51 | GLint stencilBits;
|
---|
52 |
|
---|
53 | GLint numAuxBuffers;
|
---|
54 |
|
---|
55 | GLint level;
|
---|
56 |
|
---|
57 | GLint pixmapMode;
|
---|
58 |
|
---|
59 | /* GLX */
|
---|
60 | GLint visualID;
|
---|
61 | GLint visualType; /**< One of the GLX X visual types. (i.e.,
|
---|
62 | * \c GLX_TRUE_COLOR, etc.)
|
---|
63 | */
|
---|
64 |
|
---|
65 | /* EXT_visual_rating / GLX 1.2 */
|
---|
66 | GLint visualRating;
|
---|
67 |
|
---|
68 | /* EXT_visual_info / GLX 1.2 */
|
---|
69 | GLint transparentPixel;
|
---|
70 | /* colors are floats scaled to ints */
|
---|
71 | GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
|
---|
72 | GLint transparentIndex;
|
---|
73 |
|
---|
74 | /* ARB_multisample / SGIS_multisample */
|
---|
75 | GLint sampleBuffers;
|
---|
76 | GLint samples;
|
---|
77 |
|
---|
78 | /* SGIX_fbconfig / GLX 1.3 */
|
---|
79 | GLint drawableType;
|
---|
80 | GLint renderType;
|
---|
81 | GLint xRenderable;
|
---|
82 | GLint fbconfigID;
|
---|
83 |
|
---|
84 | /* SGIX_pbuffer / GLX 1.3 */
|
---|
85 | GLint maxPbufferWidth;
|
---|
86 | GLint maxPbufferHeight;
|
---|
87 | GLint maxPbufferPixels;
|
---|
88 | GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
|
---|
89 | GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
|
---|
90 |
|
---|
91 | /* SGIX_visual_select_group */
|
---|
92 | GLint visualSelectGroup;
|
---|
93 |
|
---|
94 | /* OML_swap_method */
|
---|
95 | GLint swapMethod;
|
---|
96 |
|
---|
97 | GLint screen;
|
---|
98 |
|
---|
99 | /* EXT_texture_from_pixmap */
|
---|
100 | GLint bindToTextureRgb;
|
---|
101 | GLint bindToTextureRgba;
|
---|
102 | GLint bindToMipmapTexture;
|
---|
103 | GLint bindToTextureTargets;
|
---|
104 | GLint yInverted;
|
---|
105 | };
|
---|
106 |
|
---|
107 | GLint glxConvertToXVisualType(int visualType);
|
---|
108 |
|
---|
109 | /*
|
---|
110 | ** Screen dependent data. These methods are the interface between the DIX
|
---|
111 | ** and DDX layers of the GLX server extension. The methods provide an
|
---|
112 | ** interface for context management on a screen.
|
---|
113 | */
|
---|
114 | typedef struct __GLXscreen __GLXscreen;
|
---|
115 | struct __GLXscreen {
|
---|
116 | void (*destroy) (__GLXscreen * screen);
|
---|
117 |
|
---|
118 | __GLXcontext *(*createContext) (__GLXscreen * screen,
|
---|
119 | __GLXconfig * modes,
|
---|
120 | __GLXcontext * shareContext,
|
---|
121 | unsigned num_attribs,
|
---|
122 | const uint32_t *attribs,
|
---|
123 | int *error);
|
---|
124 |
|
---|
125 | __GLXdrawable *(*createDrawable) (ClientPtr client,
|
---|
126 | __GLXscreen * context,
|
---|
127 | DrawablePtr pDraw,
|
---|
128 | XID drawId,
|
---|
129 | int type,
|
---|
130 | XID glxDrawId, __GLXconfig * modes);
|
---|
131 | int (*swapInterval) (__GLXdrawable * drawable, int interval);
|
---|
132 |
|
---|
133 | ScreenPtr pScreen;
|
---|
134 |
|
---|
135 | /* Linked list of valid fbconfigs for this screen. */
|
---|
136 | __GLXconfig *fbconfigs;
|
---|
137 | int numFBConfigs;
|
---|
138 |
|
---|
139 | /* Subset of fbconfigs that are exposed as GLX visuals. */
|
---|
140 | __GLXconfig **visuals;
|
---|
141 | GLint numVisuals;
|
---|
142 |
|
---|
143 | char *GLextensions;
|
---|
144 |
|
---|
145 | char *GLXvendor;
|
---|
146 | char *GLXextensions;
|
---|
147 |
|
---|
148 | /**
|
---|
149 | * \name GLX version supported by this screen.
|
---|
150 | *
|
---|
151 | * Since the GLX version advertised by the server is for the whole server,
|
---|
152 | * the GLX protocol code uses the minimum version supported on all screens.
|
---|
153 | */
|
---|
154 | /*@{ */
|
---|
155 | unsigned GLXmajor;
|
---|
156 | unsigned GLXminor;
|
---|
157 | /*@} */
|
---|
158 |
|
---|
159 | Bool (*CloseScreen) (ScreenPtr pScreen);
|
---|
160 | };
|
---|
161 |
|
---|
162 | void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
|
---|
163 | void __glXScreenDestroy(__GLXscreen * screen);
|
---|
164 |
|
---|
165 | #endif /* !__GLX_screens_h__ */
|
---|