Skip to content

Commit

Permalink
Return Err instead of panic on surfaceless GLX contexts
Browse files Browse the repository at this point in the history
Co-authored-by: Marijn Suijten <marijns95@gmail.com>
  • Loading branch information
unlimitedbacon and MarijnS95 authored May 27, 2022
1 parent 7e33024 commit 07c461e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Unreleased

- Fix crash when creating OpenGLES context without explicit version
- Add `buffer_age` method on `WindowedContext`
- Fix crash when creating OpenGLES context without explicit version.
- Add `buffer_age` method on `WindowedContext`.
- On Android, switched from `StaticStructGenerator` to `StructGenerator`, fixing some compilation errors.
- Return an `Err` instead of panicking when surfaceless GLX context creation fails on Linux.

# Version 0.28.0 (2021-12-02)

Expand Down
6 changes: 5 additions & 1 deletion glutin/src/platform_impl/unix/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ impl Context {
// Prototype::Glx(ctx) =>
// X11Context::Glx(ctx.finish_surfaceless(xwin)?),
Prototype::Egl(ctx) => X11Context::Egl(ctx.finish_surfaceless()?),
_ => unimplemented!(),
_ => {
return Err(CreationError::NotSupported(
"Surfaceless GLX context not implemented".to_string(),
))
}
};

let context = Context::Surfaceless(ContextInner { context });
Expand Down

0 comments on commit 07c461e

Please sign in to comment.