Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

fixing GL namespace in readme #5

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,23 @@ After that, write a quick script to toy with it. For example:
window = Glfw::Window.new(800, 600, "Foobar")

# Set some callbacks
window.set_key_callback {
|window, key, code, action, mods|
window.set_key_callback do |window, key, code, action, mods|
window.should_close = true if key == Glfw::KEY_ESCAPE
}
end

window.set_close_callback {
|window|
window.set_close_callback do |window|
window.should_close = true
}
end

# Make the window's context current
window.make_context_current
loop {
loop do
# And do stuff
Glfw.wait_events
Gl.glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT)
GL.glClear(GL::GL_COLOR_BUFFER_BIT | GL::GL_DEPTH_BUFFER_BIT)
window.swap_buffers
break if window.should_close?
}
end

# Explicitly destroy the window when done with it.
window.destroy
Expand Down