mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
Indicate the exact error when eglMakeCurrent or eglSwapBuffers fail
This commit is contained in:
parent
15dfbd1ef6
commit
6f7a2fa1e7
|
@ -129,10 +129,9 @@ impl GlContext for Context {
|
||||||
let ret = self.egl.MakeCurrent(self.display, self.surface, self.surface, self.context);
|
let ret = self.egl.MakeCurrent(self.display, self.surface, self.surface, self.context);
|
||||||
|
|
||||||
if ret == 0 {
|
if ret == 0 {
|
||||||
if self.egl.GetError() as u32 == ffi::egl::CONTEXT_LOST {
|
match self.egl.GetError() as u32 {
|
||||||
return Err(ContextError::ContextLost);
|
ffi::egl::CONTEXT_LOST => return Err(ContextError::ContextLost),
|
||||||
} else {
|
err => panic!("eglMakeCurrent failed (eglGetError returned 0x{:x})", err)
|
||||||
panic!("eglMakeCurrent failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -158,10 +157,9 @@ impl GlContext for Context {
|
||||||
};
|
};
|
||||||
|
|
||||||
if ret == 0 {
|
if ret == 0 {
|
||||||
if unsafe { self.egl.GetError() } as u32 == ffi::egl::CONTEXT_LOST {
|
match unsafe { self.egl.GetError() } as u32 {
|
||||||
return Err(ContextError::ContextLost);
|
ffi::egl::CONTEXT_LOST => return Err(ContextError::ContextLost),
|
||||||
} else {
|
err => panic!("eglSwapBuffers failed (eglGetError returned 0x{:x})", err)
|
||||||
panic!("eglSwapBuffers failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue