Last active
August 29, 2015 14:10
-
-
Save brendanzab/bf93fa9d123508aec8ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// user application | |
loop { | |
window.poll_events(); | |
} | |
// mac/glutin | |
fn poll_events(&self) { | |
nsapp_waitevent(); | |
nsapp_sendevent(); | |
match event.type { | |
mouse => .. | |
key => .. | |
} | |
} | |
// internal cocoa | |
fn nsapp_sendevent() { | |
if event == beginResize { | |
while (resizing) { | |
window.delegate(framebuffer size changed) | |
} | |
send endResize; | |
} else { | |
// handle other events, e.g. mouse | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment