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