gsdx:EGL: prefer EGL over GLX + add some error messages

This commit is contained in:
Gregory Hainaut 2015-08-12 09:55:16 +02:00
parent 84e6fb45e8
commit 2f9d5334ee
2 changed files with 10 additions and 5 deletions

View File

@ -310,10 +310,11 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
break;
}
#else
wnd[0] = new GSWndOGL();
#ifdef EGL_SUPPORTED
wnd[1] = new GSWndEGL();
wnd[0] = new GSWndEGL();
wnd[1] = new GSWndOGL();
#else
wnd[0] = new GSWndOGL();
wnd[1] = NULL;
#endif
#endif

View File

@ -58,7 +58,7 @@ void GSWndEGL::CreateContext(int major, int minor)
eglChooseConfig(m_eglDisplay, attrList, &eglConfig, 1, &numConfigs);
if ( numConfigs == 0 )
{
fprintf(stderr,"EGL: Failed to get a frame buffer config!\n");
fprintf(stderr,"EGL: Failed to get a frame buffer config! (0x%x)\n", eglGetError() );
throw GSDXRecoverableError();
}
@ -283,11 +283,15 @@ void GSWndEGL::OpenEGLDisplay()
{
// Create an EGL display from the native display
m_eglDisplay = eglGetDisplay((EGLNativeDisplayType)m_NativeDisplay);
if ( m_eglDisplay == EGL_NO_DISPLAY )
if ( m_eglDisplay == EGL_NO_DISPLAY ) {
fprintf(stderr,"EGL: Failed to open a display! (0x%x)\n", eglGetError() );
throw GSDXRecoverableError();
}
if ( !eglInitialize(m_eglDisplay, NULL, NULL) )
if ( !eglInitialize(m_eglDisplay, NULL, NULL) ) {
fprintf(stderr,"EGL: Failed to initialize the display! (0x%x)\n", eglGetError() );
throw GSDXRecoverableError();
}
}
#endif