Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on window.rs #107

Closed
bvssvni opened this issue Jan 12, 2016 · 0 comments
Closed

Notes on window.rs #107

bvssvni opened this issue Jan 12, 2016 · 0 comments

Comments

@bvssvni
Copy link
Member

bvssvni commented Jan 12, 2016

Posting notes here to improve the documentation.

  1. Glium's Backend takes &self in all methods
  2. Because of 1) a mutable reference to the window must be created from an immutable one
  3. To solve 2) a Rc<RefCell<W>> is used in the Wrapper struct, which implements Backend
  4. Because of 3) the user is required to wrap the window in Rc<RefCell<W>> at startup

Rc<RefCell<W>> might have some issues with if let and while let expressions. When using GliumWindow::next, this is not a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant