static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer, int samples)
{
*attrib++ = AGL_RGBA;
- *attrib++ = AGL_RED_SIZE;*attrib++ = 1;
- *attrib++ = AGL_GREEN_SIZE;*attrib++ = 1;
- *attrib++ = AGL_BLUE_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_RED_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = AGL_GREEN_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = AGL_BLUE_SIZE;*attrib++ = stencil ? 8 : 5;
*attrib++ = AGL_DOUBLEBUFFER;
- *attrib++ = AGL_DEPTH_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_DEPTH_SIZE;*attrib++ = stencil ? 24 : 16;
// if stencil is enabled, ask for alpha too
if (stencil)
{
*attrib++ = AGL_STENCIL_SIZE;*attrib++ = 8;
- *attrib++ = AGL_ALPHA_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_ALPHA_SIZE;*attrib++ = 8;
}
if (fullscreen)
*attrib++ = AGL_FULLSCREEN;
void VID_BuildGLXAttrib(int *attrib, qboolean stencil, qboolean stereobuffer, int samples)
{
*attrib++ = GLX_RGBA;
- *attrib++ = GLX_RED_SIZE;*attrib++ = 1;
- *attrib++ = GLX_GREEN_SIZE;*attrib++ = 1;
- *attrib++ = GLX_BLUE_SIZE;*attrib++ = 1;
+ *attrib++ = GLX_RED_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = GLX_GREEN_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = GLX_BLUE_SIZE;*attrib++ = stencil ? 8 : 5;
*attrib++ = GLX_DOUBLEBUFFER;
- *attrib++ = GLX_DEPTH_SIZE;*attrib++ = 1;
+ *attrib++ = GLX_DEPTH_SIZE;*attrib++ = stencil ? 24 : 16;
// if stencil is enabled, ask for alpha too
if (stencil)
{
*attrib++ = GLX_STENCIL_SIZE;*attrib++ = 8;
- *attrib++ = GLX_ALPHA_SIZE;*attrib++ = 1;
+ *attrib++ = GLX_ALPHA_SIZE;*attrib++ = 8;
}
if (stereobuffer)
*attrib++ = GLX_STEREO;
- if (samples)
+ if (samples > 1)
{
*attrib++ = GLX_SAMPLE_BUFFERS_ARB;
*attrib++ = 1;
}
else
{
- SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 1);
- SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 1);
- SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 1);
+ SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
+ SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
+ SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16);
}
if (stereobuffer)
// if stencil is enabled, ask for alpha too
if (bpp >= 32)
{
- pfd.cStencilBits = 8;
+ pfd.cRedBits = 8;
+ pfd.cGreenBits = 8;
+ pfd.cBlueBits = 8;
pfd.cAlphaBits = 8;
+ pfd.cDepthBits = 24;
+ pfd.cStencilBits = 8;
}
else
{
- pfd.cStencilBits = 0;
+ pfd.cRedBits = 5;
+ pfd.cGreenBits = 5;
+ pfd.cBlueBits = 5;
pfd.cAlphaBits = 0;
+ pfd.cDepthBits = 16;
+ pfd.cStencilBits = 0;
}
if (stereobuffer)
*a++ = WGL_BLUE_BITS_ARB;
*a++ = 8;
*a++ = WGL_ALPHA_BITS_ARB;
- *a++ = 1;
+ *a++ = 8;
*a++ = WGL_DEPTH_BITS_ARB;
*a++ = 24;
*a++ = WGL_STENCIL_BITS_ARB;