use std::ops::Deref; use std::rc::Rc; use super::bindings::{types, Gl as InnerGl}; #[derive(Clone)] pub struct Gl(Rc); impl Gl { pub fn load_with(f: F) -> Self where F: FnMut(&'static str) -> *const types::GLvoid, { Gl(Rc::new(InnerGl::load_with(f))) } } impl Deref for Gl { type Target = InnerGl; fn deref(&self) -> &Self::Target { &self.0 } }