|
2 | 2 |
|
3 | 3 | extern crate gl;
|
4 | 4 | extern crate glfw;
|
5 |
| -extern crate native; |
6 | 5 |
|
7 | 6 | use std::mem;
|
8 | 7 | use std::ptr;
|
@@ -57,22 +56,16 @@ static FS_SRC: &'static str = r#"
|
57 | 56 | "#;
|
58 | 57 |
|
59 | 58 |
|
60 |
| -#[start] |
61 |
| -fn start(argc: int, argv: *const *const u8) -> int { |
62 |
| - // Run GLFW on the main thread |
63 |
| - native::start(argc, argv, main) |
64 |
| -} |
65 |
| - |
66 | 59 | fn main() {
|
67 | 60 | let glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
|
68 | 61 |
|
69 | 62 | // Choose a GL profile
|
70 |
| - glfw.window_hint(glfw::ContextVersion(3, 2)); |
71 |
| - glfw.window_hint(glfw::OpenglForwardCompat(true)); |
72 |
| - glfw.window_hint(glfw::OpenglProfile(glfw::OpenGlCoreProfile)); |
| 63 | + glfw.window_hint(glfw::WindowHint::ContextVersion(3, 2)); |
| 64 | + glfw.window_hint(glfw::WindowHint::OpenglForwardCompat(true)); |
| 65 | + glfw.window_hint(glfw::WindowHint::OpenglProfile(glfw::OpenGlProfileHint::Core)); |
73 | 66 |
|
74 | 67 | // Create Window
|
75 |
| - let (window, events) = glfw.create_window(1024, 768, "Stainless", glfw::Windowed) |
| 68 | + let (window, events) = glfw.create_window(1024, 768, "Stainless", glfw::WindowMode::Windowed) |
76 | 69 | .expect("Failed to create GLFW window.");
|
77 | 70 |
|
78 | 71 | // Window configuration
|
@@ -215,7 +208,7 @@ fn link_program(vs: GLuint, fs: GLuint) -> GLuint {
|
215 | 208 | fn handle_window_event(window: &glfw::Window, event: glfw::WindowEvent) {
|
216 | 209 | println!("{}", event);
|
217 | 210 | match event {
|
218 |
| - glfw::KeyEvent(glfw::KeyEscape, _, glfw::Press, _) => { |
| 211 | + glfw::WindowEvent::Key(glfw::Key::Escape, _, glfw::Action::Press, _) => { |
219 | 212 | window.set_should_close(true)
|
220 | 213 | }
|
221 | 214 | _ => {}
|
|
0 commit comments