diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-02-22 12:47:42 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-02-22 12:47:42 +0100 |
commit | 9c8b49fec2210ddd081c97b75236d159b4f9e7b7 (patch) | |
tree | b1ff64b067a2d8f26b3e6760de2225524f480916 | |
parent | 07a584fd28e129be9b20bdcb7f3cbba5cd211d15 (diff) | |
parent | 0e6f37903c0d6ea9a01c8890703e128a6a67b51d (diff) | |
download | glutin-9c8b49fec2210ddd081c97b75236d159b4f9e7b7.tar.gz glutin-9c8b49fec2210ddd081c97b75236d159b4f9e7b7.zip |
Merge pull request #293 from tomaka/tomaka-patch-2
Fix the README example
-rw-r--r-- | README.md | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -30,6 +30,13 @@ cargo run --example window ## Usage +Glutin is an OpenGL context creation library and doesn't directly provide OpenGL bindings for you. + +```toml +[dependencies] +gl = "*" +``` + ```rust extern crate glutin; extern crate libc; @@ -40,14 +47,16 @@ fn main() { unsafe { window.make_current() }; - gl::load_with(|symbol| window.get_proc_address(symbol)); + unsafe { + gl::load_with(|symbol| window.get_proc_address(symbol)); - gl::ClearColor(0.0, 1.0, 0.0, 1.0); + gl::ClearColor(0.0, 1.0, 0.0, 1.0); + } while !window.is_closed() { window.wait_events(); - gl::Clear(gl::COLOR_BUFFER_BIT); + unsafe { gl::Clear(gl::COLOR_BUFFER_BIT) }; window.swap_buffers(); } |