diff options
| author | HampusM <hampus@hampusmat.com> | 2026-04-20 15:07:56 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-04-20 15:07:56 +0200 |
| commit | 62e503a646397124e29948c786bb174289f39020 (patch) | |
| tree | a2f3a9d10b4178c742fb9cff1e6eda1ffe997da6 /opengl-bindings/src/lib.rs | |
| parent | 180a3206aae57d16493e6268d816083c2c2fbd91 (diff) | |
fix(opengl-bindings): check surface is current in ContextWithFns::make_current
Diffstat (limited to 'opengl-bindings/src/lib.rs')
| -rw-r--r-- | opengl-bindings/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opengl-bindings/src/lib.rs b/opengl-bindings/src/lib.rs index af80e69..e5051d5 100644 --- a/opengl-bindings/src/lib.rs +++ b/opengl-bindings/src/lib.rs @@ -5,7 +5,7 @@ use std::process::abort; use glutin::context::{NotCurrentContext, PossiblyCurrentContext}; use glutin::display::GetGlDisplay; use glutin::prelude::{GlDisplay, NotCurrentGlContext, PossiblyCurrentGlContext}; -use glutin::surface::{Surface, SurfaceTypeTrait}; +use glutin::surface::{GlSurface, Surface, SurfaceTypeTrait}; pub mod blending; pub mod buffer; @@ -60,7 +60,7 @@ impl ContextWithFns surface: &Surface<SurfaceType>, ) -> Result<CurrentContextWithFns<'_>, Error> { - if !self.context.is_current() { + if !self.context.is_current() || !surface.is_current(&self.context) { self.context .make_current(surface) .map_err(Error::MakeContextCurrentFailed)?; |
