glxscreens.h revision 65fea56f17cd614bc8908264df980a62e1931468
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#ifdef HAVE_DIX_CONFIG_H
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#include <dix-config.h>
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#endif
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#ifndef _GLX_screens_h_
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#define _GLX_screens_h_
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major/*
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major *
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Permission is hereby granted, free of charge, to any person obtaining a
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * copy of this software and associated documentation files (the "Software"),
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * to deal in the Software without restriction, including without limitation
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * the rights to use, copy, modify, merge, publish, distribute, sublicense,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * and/or sell copies of the Software, and to permit persons to whom the
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Software is furnished to do so, subject to the following conditions:
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major *
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * The above copyright notice including the dates of first publication and
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * either this permission notice or a reference to
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * http://oss.sgi.com/projects/FreeB/
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * shall be included in all copies or substantial portions of the Software.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major *
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura * SOFTWARE.
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura *
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura * Except as contained in this notice, the name of Silicon Graphics, Inc.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * shall not be used in advertising or otherwise to promote the sale, use or
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * other dealings in this Software without prior written authorization from
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Silicon Graphics, Inc.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majortypedef struct __GLXconfig __GLXconfig;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorstruct __GLXconfig {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXconfig *next;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLuint doubleBufferMode;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLuint stereoMode;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLuint redMask, greenMask, blueMask, alphaMask;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint rgbBits; /* total bits for rgb */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint indexBits; /* total bits for colorindex */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint depthBits;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint stencilBits;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint numAuxBuffers;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint level;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* GLX */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint visualID;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint visualType; /**< One of the GLX X visual types. (i.e.,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * \c GLX_TRUE_COLOR, etc.)
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* EXT_visual_rating / GLX 1.2 */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint visualRating;
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura
8f8adeb1540d89588dba4c26d00a6ed6887cf6deKohei Tamura /* EXT_visual_info / GLX 1.2 */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint transparentPixel;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* colors are floats scaled to ints */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint transparentIndex;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* ARB_multisample / SGIS_multisample */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint sampleBuffers;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint samples;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* SGIX_fbconfig / GLX 1.3 */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint drawableType;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint renderType;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint xRenderable;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint fbconfigID;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* SGIX_pbuffer / GLX 1.3 */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint maxPbufferWidth;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint maxPbufferHeight;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint maxPbufferPixels;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* SGIX_visual_select_group */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint visualSelectGroup;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* OML_swap_method */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint swapMethod;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* EXT_texture_from_pixmap */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint bindToTextureRgb;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint bindToTextureRgba;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint bindToMipmapTexture;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint bindToTextureTargets;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint yInverted;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* ARB_framebuffer_sRGB */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint sRGBCapable;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major};
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter MajorGLint glxConvertToXVisualType(int visualType);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major/*
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major** Screen dependent data. These methods are the interface between the DIX
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major** and DDX layers of the GLX server extension. The methods provide an
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major** interface for context management on a screen.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major*/
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majortypedef struct __GLXscreen __GLXscreen;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorstruct __GLXscreen {
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major void (*destroy) (__GLXscreen * screen);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXcontext *(*createContext) (__GLXscreen * screen,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXconfig * modes,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXcontext * shareContext,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major unsigned num_attribs,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major const uint32_t *attribs,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major int *error);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXdrawable *(*createDrawable) (ClientPtr client,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXscreen * context,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major DrawablePtr pDraw,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major XID drawId,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major int type,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major XID glxDrawId, __GLXconfig * modes);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major int (*swapInterval) (__GLXdrawable * drawable, int interval);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major ScreenPtr pScreen;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* Linked list of valid fbconfigs for this screen. */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXconfig *fbconfigs;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major int numFBConfigs;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /* Subset of fbconfigs that are exposed as GLX visuals. */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major __GLXconfig **visuals;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major GLint numVisuals;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major char *GLextensions;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major char *GLXextensions;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /**
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * \name GLX version supported by this screen.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major *
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * Since the GLX version advertised by the server is for the whole server,
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major * the GLX protocol code uses the minimum version supported on all screens.
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /*@{ */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major unsigned GLXmajor;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major unsigned GLXminor;
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major /*@} */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major Bool (*CloseScreen) (ScreenPtr pScreen);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major};
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorvoid __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Majorvoid __glXScreenDestroy(__GLXscreen * screen);
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major#endif /* !__GLX_screens_h__ */
fb379c70e3fd8a537f311b99be4759ae41e02750Peter Major