This repo is now archived, for an up-to-date version check out raylib-cr
at https://github.com/sol-vin/raylib-cr
Crystal Bindings for raylib
, a small and easy to use game development library.
As for now the bindings only support the raw function calls from raylib itself, a wrapper will be out shortly,
I plan on making a more object-oriented wrapper around raylib.
The native libraries can be found in the native/<OSNAME>
folder of this repository.
These platforms are supported out of the box and are linked statically
x86_64-linux-gnu
= 64-bit Linuxx86_64-darwin
= 64-bit OSX
- Add
raylib-cr
to yourshard.yml
:
dependencies:
raylib-cr:
github: AregevDev/raylib-cr
- Run
shards install
require "raylib-cr"
screen_width = 800
screen_height = 450
LibRaylib.init_window screen_width, screen_height, "Hello"
frames_counter = 0
rand_value = LibRaylib.get_random_value -8, 5
LibRaylib.set_target_fps 60
until LibRaylib.window_should_close
frames_counter += 1
if (frames_counter / 120) % 2 == 1
rand_value = LibRaylib.get_random_value -8, 5
frames_counter = 0
end
LibRaylib.begin_drawing
LibRaylib.clear_background LibRaylib::RAYWHITE
LibRaylib.draw_text "Every 2 seconds a new random value is generated:", 130, 100, 20, LibRaylib::MAROON
LibRaylib.draw_text "#{rand_value}", 360, 180, 80, LibRaylib::LIGHTGRAY
LibRaylib.end_drawing
end
LibRaylib.close_window
These are my plans for v1.0.0
- Proper testing with
crystal spec
- Setup Travis CI
- OOP Wrapper
- Fork it (https://github.com/AregevDev/raylib-cr)
- 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
- AregevDev - creator and maintainer