glium: impl Facade

This commit is contained in:
Victor Berger 2017-06-13 16:52:17 +02:00
parent d819e15e29
commit bffc02c5f1
1 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,7 @@
use backend::graphics::egl::{EGLGraphicsBackend, SwapBuffersError};
use glium::Frame;
use glium::SwapBuffersError as GliumSwapBuffersError;
use glium::backend::{Backend, Context};
use glium::backend::{Backend, Context, Facade};
use glium::debug::DebugCallbackBehavior;
use std::ops::Deref;
use std::os::raw::c_void;
@ -63,6 +63,12 @@ impl<T: EGLGraphicsBackend> Deref for GliumGraphicsBackend<T> {
}
}
impl<T: EGLGraphicsBackend> Facade for GliumGraphicsBackend<T> {
fn get_context(&self) -> &Rc<Context> {
&self.context
}
}
/// Converter trait to expose `glium` compatibility for all `EGLGraphicsBackend`s
pub trait IntoGlium: EGLGraphicsBackend + Sized {
/// Wrap the given `EGLGraphicsBackend` to a `GliumGraphicBackend`