mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 04:51:52 +00:00
Fixed: #884 24bpp support (patch provided by ThibG)
This commit is contained in:
parent
ab1ca3507c
commit
ab23b5d78b
2 changed files with 16 additions and 2 deletions
|
@ -1041,6 +1041,18 @@ bool CDriverGL::setDisplay(void *wnd, const GfxMode &mode, bool show, bool resiz
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int sAttribList24bpp[] =
|
||||||
|
{
|
||||||
|
GLX_RGBA,
|
||||||
|
GLX_DOUBLEBUFFER,
|
||||||
|
//GLX_BUFFER_SIZE, 16,
|
||||||
|
GLX_DEPTH_SIZE, 24,
|
||||||
|
GLX_RED_SIZE, 8,
|
||||||
|
GLX_GREEN_SIZE, 8,
|
||||||
|
GLX_BLUE_SIZE, 8,
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
static int sAttribList32bpp[] =
|
static int sAttribList32bpp[] =
|
||||||
{
|
{
|
||||||
GLX_RGBA,
|
GLX_RGBA,
|
||||||
|
@ -1054,8 +1066,10 @@ bool CDriverGL::setDisplay(void *wnd, const GfxMode &mode, bool show, bool resiz
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
// first try 32bpp and if that fails 16bpp
|
// first try 32bpp and if that fails 24bpp or 16bpp
|
||||||
XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList32bpp);
|
XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList32bpp);
|
||||||
|
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)
|
||||||
|
|
|
@ -571,7 +571,7 @@ void checkDriverDepth ()
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
if (mode.Depth != 32)
|
if (mode.Depth != 32)
|
||||||
#else
|
#else
|
||||||
if (mode.Depth < 24)
|
if (mode.Depth != 16 && mode.Depth != 24 && mode.Depth != 32)
|
||||||
#endif
|
#endif
|
||||||
ExitClientError (CI18N::get ("uiDesktopNotIn32").toUtf8().c_str ());
|
ExitClientError (CI18N::get ("uiDesktopNotIn32").toUtf8().c_str ());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue