From 62e503a646397124e29948c786bb174289f39020 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 20 Apr 2026 15:07:56 +0200 Subject: fix(opengl-bindings): check surface is current in ContextWithFns::make_current --- opengl-bindings/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opengl-bindings/src') 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, ) -> Result, 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)?; -- cgit v1.2.3-18-g5258