From 0e6f37903c0d6ea9a01c8890703e128a6a67b51d Mon Sep 17 00:00:00 2001 From: tomaka Date: Sun, 22 Feb 2015 11:31:27 +0100 Subject: Fix the README example --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index baaf022..58e1be1 100644 --- a/README.md +++ b/README.md @@ -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(); } -- cgit v1.2.3