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