Fixed: #898 Shadows under Linux

This commit is contained in:
kervala 2010-06-07 12:20:18 +02:00
parent c71492c605
commit 293f47c367

View file

@ -1051,11 +1051,11 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
{ {
GLX_RGBA, GLX_RGBA,
GLX_DOUBLEBUFFER, GLX_DOUBLEBUFFER,
//GLX_BUFFER_SIZE, 16,
GLX_DEPTH_SIZE, 16, GLX_DEPTH_SIZE, 16,
GLX_RED_SIZE, 4, GLX_RED_SIZE, 4,
GLX_GREEN_SIZE, 4, GLX_GREEN_SIZE, 4,
GLX_BLUE_SIZE, 4, GLX_BLUE_SIZE, 4,
GLX_ALPHA_SIZE, 4,
GLX_STENCIL_SIZE, 8, GLX_STENCIL_SIZE, 8,
None None
}; };
@ -1064,33 +1064,17 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
{ {
GLX_RGBA, GLX_RGBA,
GLX_DOUBLEBUFFER, GLX_DOUBLEBUFFER,
//GLX_BUFFER_SIZE, 16,
GLX_DEPTH_SIZE, 24, GLX_DEPTH_SIZE, 24,
GLX_RED_SIZE, 8, GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8, GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8, GLX_BLUE_SIZE, 8,
GLX_STENCIL_SIZE, 8,
None
};
static int sAttribList32bpp[] =
{
GLX_RGBA,
GLX_DOUBLEBUFFER,
//GLX_BUFFER_SIZE, 32,
GLX_DEPTH_SIZE, 32,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8, GLX_ALPHA_SIZE, 8,
GLX_STENCIL_SIZE, 8, GLX_STENCIL_SIZE, 8,
None None
}; };
// first try 32bpp and if that fails 24bpp or 16bpp // first try 24bpp and if that fails 16bpp
XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList32bpp); XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList24bpp);
if (visual_info == NULL)
visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList24bpp);
if (visual_info == NULL) if (visual_info == NULL)
visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList16bpp); visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList16bpp);
if(visual_info == NULL) if(visual_info == NULL)