glfw

Version, currently 0.1.02 versions

github.com/danini-the-panini/crystal_glfw

Idiomatic Crystal API to libglfw3

5 stars
0 dependents
License: MIT

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:
  glfw:
    github: danini-the-panini/crystal_glfw
    version: ~> 0.1.0

Then run:

shards install

shard.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.

GLFW for Crystal

Idiomatic Crystal API to libglfw3. This shard provides an OOP wrapper around libglfw3, to make it easier to write GLFW apps in Crystal.

Installation

Add this to your application's shard.yml:

dependencies:
  glfw:
    github: jellymann/crystal_glfw

Usage

Example code for creating a window (tested on macOS 10.11)

require "glfw"

hints = {
  LibGLFW3::OPENGL_PROFILE => LibGLFW3::OPENGL_CORE_PROFILE,
  LibGLFW3::OPENGL_FORWARD_COMPAT => 1,
  LibGLFW3::CONTEXT_VERSION_MAJOR => 3,
  LibGLFW3::CONTEXT_VERSION_MINOR => 3
}

window = GLFW::Window.new(800, 600, "Hello, Crystal!", hints)

window.make_current

GLFW.swap_interval = 1

until window.should_close?
  window.swap_buffers
  GLFW.poll_for_events
end

Development

To run the specs

crystal spec

See also

  1. LibGL bindings for Crystal
  2. LibGLFW3 bindings for Crystal
  3. Crystal OpenGL Samples

Contributing

  1. Fork it ( https://github.com/jellymann/crystal_glfw/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • jellymann Daniel Smith - creator, maintainer