summaryrefslogtreecommitdiff
path: root/opengl-bindings/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings/src/lib.rs')
-rw-r--r--opengl-bindings/src/lib.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/opengl-bindings/src/lib.rs b/opengl-bindings/src/lib.rs
index e5051d5..cfdfa35 100644
--- a/opengl-bindings/src/lib.rs
+++ b/opengl-bindings/src/lib.rs
@@ -31,11 +31,11 @@ impl ContextWithFns
pub fn new<SurfaceType: SurfaceTypeTrait>(
context: NotCurrentContext,
surface: &Surface<SurfaceType>,
- ) -> Result<Self, Error>
+ ) -> Result<Self, MakeContextCurrentError>
{
let context = context
.make_current(surface)
- .map_err(Error::MakeContextCurrentFailed)?;
+ .map_err(MakeContextCurrentError)?;
let display = context.display();
@@ -58,12 +58,12 @@ impl ContextWithFns
pub fn make_current<SurfaceType: SurfaceTypeTrait>(
&self,
surface: &Surface<SurfaceType>,
- ) -> Result<CurrentContextWithFns<'_>, Error>
+ ) -> Result<CurrentContextWithFns<'_>, MakeContextCurrentError>
{
if !self.context.is_current() || !surface.is_current(&self.context) {
self.context
.make_current(surface)
- .map_err(Error::MakeContextCurrentFailed)?;
+ .map_err(MakeContextCurrentError)?;
}
Ok(CurrentContextWithFns { ctx: self })
@@ -97,11 +97,8 @@ impl CurrentContextWithFns<'_>
}
#[derive(Debug, thiserror::Error)]
-pub enum Error
-{
- #[error("Failed to make context current")]
- MakeContextCurrentFailed(#[source] glutin::error::Error),
-}
+#[error("Failed to make context current")]
+pub struct MakeContextCurrentError(#[source] glutin::error::Error);
mod sys
{