summaryrefslogtreecommitdiff
path: root/opengl-bindings/src
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings/src')
-rw-r--r--opengl-bindings/src/lib.rs4
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)?;