mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Add CreationError::RobustnessNotSupported
This commit is contained in:
parent
ca1eb8dc53
commit
ba5adfa1e1
|
@ -335,7 +335,7 @@ impl Window {
|
||||||
|
|
||||||
match builder.gl_robustness {
|
match builder.gl_robustness {
|
||||||
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,7 +434,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
|
||||||
context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as libc::c_int);
|
context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as libc::c_int);
|
||||||
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int;
|
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int;
|
||||||
} else {
|
} else {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
|
||||||
context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as libc::c_int);
|
context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as libc::c_int);
|
||||||
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int;
|
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int;
|
||||||
} else {
|
} else {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
|
||||||
// robustness is not supported
|
// robustness is not supported
|
||||||
match gl_robustness {
|
match gl_robustness {
|
||||||
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ fn create_context(glx: &ffi::glx::Glx, extra_functions: &ffi::glx_extra::Glx, ex
|
||||||
} else {
|
} else {
|
||||||
match robustness {
|
match robustness {
|
||||||
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl OsMesaContext {
|
||||||
|
|
||||||
match builder.gl_robustness {
|
match builder.gl_robustness {
|
||||||
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
||||||
return Err(CreationError::NotSupported.into());
|
return Err(CreationError::RobustnessNotSupported.into());
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,7 +290,7 @@ unsafe fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'st
|
||||||
} else {
|
} else {
|
||||||
match builder.gl_robustness {
|
match builder.gl_robustness {
|
||||||
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
|
||||||
return Err(CreationError::NotSupported);
|
return Err(CreationError::RobustnessNotSupported);
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@ pub trait GlContext {
|
||||||
pub enum CreationError {
|
pub enum CreationError {
|
||||||
OsError(String),
|
OsError(String),
|
||||||
NotSupported,
|
NotSupported,
|
||||||
|
RobustnessNotSupported,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CreationError {
|
impl CreationError {
|
||||||
|
@ -116,6 +117,8 @@ impl CreationError {
|
||||||
match *self {
|
match *self {
|
||||||
CreationError::OsError(ref text) => &text,
|
CreationError::OsError(ref text) => &text,
|
||||||
CreationError::NotSupported => "Some of the requested attributes are not supported",
|
CreationError::NotSupported => "Some of the requested attributes are not supported",
|
||||||
|
CreationError::RobustnessNotSupported => "Your requested robustness, but it is \
|
||||||
|
not supported.",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue