return zBits;
}
+static GLint
+default_accum_bits(void)
+{
+ return 16;
+}
+
/*
{
int vislevel;
GLint zBits = default_depth_bits();
+ GLint accBits = default_accum_bits();
vislevel = level_of_visual( dpy, visinfo );
if (vislevel) {
GL_FALSE, /* stereo */
zBits,
STENCIL_BITS,
- ACCUM_BITS, /* r */
- ACCUM_BITS, /* g */
- ACCUM_BITS, /* b */
- ACCUM_BITS, /* a */
+ accBits, /* r */
+ accBits, /* g */
+ accBits, /* b */
+ accBits, /* a */
0, /* level */
0 /* numAux */
);
stencil_size = STENCIL_BITS;
if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 ||
accumAlphaSize > 0) {
- accumRedSize = ACCUM_BITS;
- accumGreenSize = ACCUM_BITS;
- accumBlueSize = ACCUM_BITS;
- accumAlphaSize = alpha_flag ? ACCUM_BITS : 0;
+ accumRedSize =
+ accumGreenSize =
+ accumBlueSize = default_accum_bits();
+ accumAlphaSize = alpha_flag ? accumRedSize : 0;
}
xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
*/
#define TRIANGLE_WALK_DOUBLE 0
-/**
- * Bits per accumulation buffer color component: 8, 16 or 32
- */
-#define ACCUM_BITS 16
/**
* Bits per depth buffer value.
if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
return GL_FALSE;
}
- if (accumRedBits < 0 || accumRedBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumGreenBits < 0 || accumGreenBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumBlueBits < 0 || accumBlueBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumAlphaBits < 0 || accumAlphaBits > ACCUM_BITS) {
- return GL_FALSE;
- }
+ assert(accumRedBits >= 0);
+ assert(accumGreenBits >= 0);
+ assert(accumBlueBits >= 0);
+ assert(accumAlphaBits >= 0);
vis->rgbMode = rgbFlag;
vis->doubleBufferMode = dbFlag;
#endif
-#if ACCUM_BITS != 16
-/* Software accum done with GLshort at this time */
-# error "illegal number of accumulation bits"
-#endif
-
-
/**
* Stencil buffer data type.
*/
*/
-#if CHAN_BITS == 8 && ACCUM_BITS <= 32
+#if CHAN_BITS == 8
/* enable the optimization */
#define USE_OPTIMIZED_ACCUM 1
#else