Added a catch-all OpenGL visual. This allows the VideoSoftware plug-in to run under VirtualBox.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5454 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
950df7eaff
commit
869f5e64c7
|
@ -347,6 +347,14 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
GLX_DEPTH_SIZE, 24,
|
||||
GLX_SAMPLE_BUFFERS_ARB, g_Config.iMultisampleMode, GLX_SAMPLES_ARB, 1, None };
|
||||
|
||||
int attrListDefault[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_DEPTH_SIZE, 1,
|
||||
None };
|
||||
|
||||
GLWin.dpy = XOpenDisplay(0);
|
||||
GLWin.parent = (Window)g_VideoInitialize.pWindowHandle;
|
||||
|
@ -361,9 +369,22 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
|
||||
/* get an appropriate visual */
|
||||
GLWin.vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListDbl);
|
||||
if (GLWin.vi == NULL) {
|
||||
if (GLWin.vi == NULL)
|
||||
{
|
||||
GLWin.vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListSgl);
|
||||
ERROR_LOG(VIDEO, "Only Singlebuffered Visual!");
|
||||
if (GLWin.vi != NULL)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Only Singlebuffered Visual!");
|
||||
}
|
||||
else
|
||||
{
|
||||
GLWin.vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListDefault);
|
||||
if (GLWin.vi == NULL)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Could not choose visual (glXChooseVisual)");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
NOTICE_LOG(VIDEO, "Got Doublebuffered Visual!");
|
||||
|
|
|
@ -271,6 +271,16 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight
|
|||
GLX_BLUE_SIZE, 8,
|
||||
GLX_DEPTH_SIZE, 24,
|
||||
GLX_SAMPLE_BUFFERS_ARB, GLX_SAMPLES_ARB, 1, None };
|
||||
|
||||
int attrListDefault[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_DEPTH_SIZE, 1,
|
||||
None };
|
||||
|
||||
GLWin.dpy = XOpenDisplay(0);
|
||||
GLWin.parent = (Window)g_VideoInitialize.pWindowHandle;
|
||||
g_VideoInitialize.pWindowHandle = (HWND)GLWin.dpy;
|
||||
|
@ -278,9 +288,22 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight
|
|||
|
||||
/* get an appropriate visual */
|
||||
vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListDbl);
|
||||
if (vi == NULL) {
|
||||
if (vi == NULL)
|
||||
{
|
||||
vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListSgl);
|
||||
ERROR_LOG(VIDEO, "Only Singlebuffered Visual!");
|
||||
if (vi != NULL)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Only Singlebuffered Visual!");
|
||||
}
|
||||
else
|
||||
{
|
||||
vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListDefault);
|
||||
if (vi == NULL)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Could not choose visual (glXChooseVisual)");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
NOTICE_LOG(VIDEO, "Got Doublebuffered Visual!");
|
||||
|
|
Loading…
Reference in New Issue