First import
[xorg_rtime.git] / xorg-server-1.4 / hw / dmx / glxProxy / glxfbconfig.c
blobf2321b10c3161e9e94cdf04e746da3fdb956408d
1 /*
2 ** License Applicability. Except to the extent portions of this file are
3 ** made subject to an alternative license as permitted in the SGI Free
4 ** Software License B, Version 1.1 (the "License"), the contents of this
5 ** file are subject only to the provisions of the License. You may not use
6 ** this file except in compliance with the License. You may obtain a copy
7 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
8 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
9 **
10 ** http://oss.sgi.com/projects/FreeB
12 ** Note that, as provided in the License, the Software is distributed on an
13 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
14 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
15 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
16 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18 ** Original Code. The Original Code is: OpenGL Sample Implementation,
19 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
20 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21 ** Copyright in any portions created by third parties is as indicated
22 ** elsewhere herein. All Rights Reserved.
24 ** Additional Notice Provisions: The application programming interfaces
25 ** established by SGI in conjunction with the Original Code are The
26 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
27 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
28 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
29 ** Window System(R) (Version 1.3), released October 19, 1998. This software
30 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
31 ** published by SGI, but has not been independently verified as being
32 ** compliant with the OpenGL(R) version 1.2.1 Specification.
36 #include "glxfbconfig.h"
38 int AreFBConfigsMatch( __GLXFBConfig *c1, __GLXFBConfig *c2 )
40 int match;
42 match = (
43 (c1->visualType == c2->visualType) &&
44 (c1->transparentType == c2->transparentType) &&
45 (c1->transparentRed == c2->transparentRed) &&
46 (c1->transparentGreen == c2->transparentGreen) &&
47 (c1->transparentBlue == c2->transparentBlue) &&
48 (c1->transparentAlpha == c2->transparentAlpha) &&
49 (c1->transparentIndex == c2->transparentIndex) &&
50 (c1->visualCaveat == c2->visualCaveat) &&
51 (c1->drawableType == c2->drawableType) &&
52 (c1->renderType == c2->renderType) &&
53 #if 0
54 (c1->maxPbufferWidth == c2->maxPbufferWidth) &&
55 (c1->maxPbufferHeight == c2->maxPbufferHeight) &&
56 (c1->maxPbufferPixels == c2->maxPbufferPixels) &&
57 (c1->optimalPbufferWidth == c2->optimalPbufferWidth) &&
58 (c1->optimalPbufferHeight == c2->optimalPbufferHeight) &&
59 #endif
60 (c1->visualSelectGroup == c2->visualSelectGroup) &&
61 (c1->rgbMode == c2->rgbMode) &&
62 (c1->colorIndexMode == c2->colorIndexMode) &&
63 (c1->doubleBufferMode == c2->doubleBufferMode) &&
64 (c1->stereoMode == c2->stereoMode) &&
65 (c1->haveAccumBuffer == c2->haveAccumBuffer) &&
66 (c1->haveDepthBuffer == c2->haveDepthBuffer) &&
67 (c1->haveStencilBuffer == c2->haveStencilBuffer) &&
68 (c1->accumRedBits == c2->accumRedBits) &&
69 (c1->accumGreenBits == c2->accumGreenBits) &&
70 (c1->accumBlueBits == c2->accumBlueBits) &&
71 (c1->accumAlphaBits == c2->accumAlphaBits) &&
72 (c1->depthBits == c2->depthBits) &&
73 (c1->stencilBits == c2->stencilBits) &&
74 (c1->indexBits == c2->indexBits) &&
75 (c1->redBits == c2->redBits) &&
76 (c1->greenBits == c2->greenBits) &&
77 (c1->blueBits == c2->blueBits) &&
78 (c1->alphaBits == c2->alphaBits) &&
79 (c1->redMask == c2->redMask) &&
80 (c1->greenMask == c2->greenMask) &&
81 (c1->blueMask == c2->blueMask) &&
82 (c1->alphaMask == c2->alphaMask) &&
83 (c1->multiSampleSize == c2->multiSampleSize) &&
84 (c1->nMultiSampleBuffers == c2->nMultiSampleBuffers) &&
85 (c1->maxAuxBuffers == c2->maxAuxBuffers) &&
86 (c1->level == c2->level) &&
87 (c1->extendedRange == c2->extendedRange) &&
88 (c1->minRed == c2->minRed) &&
89 (c1->maxRed == c2->maxRed) &&
90 (c1->minGreen == c2->minGreen) &&
91 (c1->maxGreen == c2->maxGreen) &&
92 (c1->minBlue == c2->minBlue) &&
93 (c1->maxBlue == c2->maxBlue) &&
94 (c1->minAlpha == c2->minAlpha) &&
95 (c1->maxAlpha == c2->maxAlpha)
98 return( match );
101 __GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, int nconfigs )
103 int i;
105 for (i=0; i<nconfigs; i++) {
106 if ( AreFBConfigsMatch( c, configs + i ) )
107 return( configs + i );
110 return(0);