lib_glfw3
Version, currently 0.1.02 versions
- 0.1.1latestAug 28, 2018
- 0.1.0not indexedAug 28, 2018
github.com/Groogy/crystal_lib_glfw3
libglfw3 bindings for Crystal
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
lib_glfw3:
github: Groogy/crystal_lib_glfw3
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Crystal LibGLFW3
Note: Original binding was done by jellyman. I have however made a fork with fixes needed as it seems this user is not active anymore on this repo and I can't get my pull requests approved. Hence why this fork is independent of the original.
libglfw3 bindings for Crystal. See also my Idiomatic API which makes these bindings more accessible for Crystalists.
Installation
Add to your shards.yml:
dependencies:
lib_glfw3:
github: Groogy/crystal_lib_glfw3
version: 0.1.1
Make sure you have libglfw3 installed on your system
On macOS you can install with homebrew:
brew install glfw3
Usage
Example code for creating a window (tested on macOS 10.11)
require "lib_glfw3"
if LibGLFW3.init != 0
error_callback = ->(error : Int32, description : Int8*) {
puts "Error #{error}: #{String.new(description.as(UInt8*))}"
}
LibGLFW3.setErrorCallback(error_callback)
LibGLFW3.windowHint(LibGLFW3::OPENGL_PROFILE, LibGLFW3::OPENGL_CORE_PROFILE)
LibGLFW3.windowHint(LibGLFW3::OPENGL_FORWARD_COMPAT, 1)
LibGLFW3.windowHint(LibGLFW3::CONTEXT_VERSION_MAJOR, 3)
LibGLFW3.windowHint(LibGLFW3::CONTEXT_VERSION_MINOR, 3)
window = LibGLFW3.createWindow(800, 600, "Hello Crystal!", nil, nil)
if window
LibGLFW3.makeContextCurrent(window)
LibGLFW3.swapInterval(1)
while LibGLFW3.windowShouldClose(window) == 0
LibGLFW3.swapBuffers(window)
LibGLFW3.pollEvents
end
LibGLFW3.destroyWindow(window)
else
puts "Failed to create window"
end
LibGLFW3.terminate
else
puts "GLFW failed to initialize"
end
See Also
- LibGL bindings for Crystal
- Idiomatic Crystal API for GLFW (makes lib_glfw3 nicer to work with)
- Crystal OpenGL Samples
Contributing
- Fork it ( https://github.com/Groogy/crystal_lib_glfw3/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Aug 28, 2018
- Commit
d559a31ed9a4- Indexed
- not yet
Dependents
Repository
github.com/Groogy/crystal_lib_glfw3
Metadata
- Created
- Aug 16, 2026
- Updated
- Sep 24, 2026
- Synced
- Sep 24, 2026
- Versions
- 2