You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 line
414 B

  1. use std::ops::Deref;
  2. use std::rc::Rc;
  3. use super::bindings::{types, Gl as InnerGl};
  4. #[derive(Clone)]
  5. pub struct Gl(Rc<InnerGl>);
  6. impl Gl {
  7. pub fn load_with<F>(f: F) -> Self
  8. where
  9. F: FnMut(&'static str) -> *const types::GLvoid,
  10. {
  11. Gl(Rc::new(InnerGl::load_with(f)))
  12. }
  13. }
  14. impl Deref for Gl {
  15. type Target = InnerGl;
  16. fn deref(&self) -> &Self::Target {
  17. &self.0
  18. }
  19. }