mirror of https://github.com/PCSX2/pcsx2.git
gsdx egl: report an error if we fail to bind the openGL API
It seems Nvidia added openGL support in 355 (whereas I have 352 on debian). I don't know the status on AMD.
This commit is contained in:
parent
d4a163e9cc
commit
99c43881df
|
@ -56,7 +56,7 @@ void GSWndEGL::CreateContext(int major, int minor)
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
eglBindAPI(EGL_OPENGL_API);
|
BindAPI();
|
||||||
|
|
||||||
eglChooseConfig(m_eglDisplay, attrList, &eglConfig, 1, &numConfigs);
|
eglChooseConfig(m_eglDisplay, attrList, &eglConfig, 1, &numConfigs);
|
||||||
if ( numConfigs == 0 )
|
if ( numConfigs == 0 )
|
||||||
|
@ -99,7 +99,7 @@ void GSWndEGL::AttachContext()
|
||||||
if (!IsContextAttached()) {
|
if (!IsContextAttached()) {
|
||||||
// The setting of the API is local to a thread. This function
|
// The setting of the API is local to a thread. This function
|
||||||
// can be called from 2 threads.
|
// can be called from 2 threads.
|
||||||
eglBindAPI(EGL_OPENGL_API);
|
BindAPI();
|
||||||
|
|
||||||
//fprintf(stderr, "Attach the context\n");
|
//fprintf(stderr, "Attach the context\n");
|
||||||
eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
|
eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
|
||||||
|
@ -122,6 +122,16 @@ void GSWndEGL::CheckContext()
|
||||||
fprintf(stderr,"EGL: extensions supported: %s\n", eglQueryString(m_eglDisplay, EGL_EXTENSIONS));
|
fprintf(stderr,"EGL: extensions supported: %s\n", eglQueryString(m_eglDisplay, EGL_EXTENSIONS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GSWndEGL::BindAPI()
|
||||||
|
{
|
||||||
|
eglBindAPI(EGL_OPENGL_API);
|
||||||
|
EGLenum api = eglQueryAPI();
|
||||||
|
if (api != EGL_OPENGL_API) {
|
||||||
|
fprintf(stderr,"EGL: Failed to bind the OpenGL API got 0x%x instead\n", api);
|
||||||
|
throw GSDXRecoverableError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool GSWndEGL::Attach(void* handle, bool managed)
|
bool GSWndEGL::Attach(void* handle, bool managed)
|
||||||
{
|
{
|
||||||
m_NativeWindow = *(Window*)handle;
|
m_NativeWindow = *(Window*)handle;
|
||||||
|
|
|
@ -37,6 +37,7 @@ class GSWndEGL : public GSWndGL
|
||||||
|
|
||||||
void CreateContext(int major, int minor);
|
void CreateContext(int major, int minor);
|
||||||
void CheckContext();
|
void CheckContext();
|
||||||
|
void BindAPI();
|
||||||
|
|
||||||
void OpenEGLDisplay();
|
void OpenEGLDisplay();
|
||||||
void CloseEGLDisplay();
|
void CloseEGLDisplay();
|
||||||
|
|
Loading…
Reference in New Issue