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.
raymath
functions are also supported, as are infix operators for vectors,
matricies, and quaternions.
These platforms are supported out of the box and are linked statically
- 64-bit Linux
- 64-bit Windows
Weak/Broken support
- MacOS
Hopefully soon
- Raspberry PI
- Run
sh rsrc/native/ubuntu/install.sh
- Add
raylib-cr
to yourshard.yml
:
dependencies:
raylib-cr:
github: sol-vin/raylib-cr
- Run
shards install
- Get programming!
- Follow the instructions at https://github.com/neatorobito/scoop-crystal to add the crystal-preview bucket to scoop
- Install crystal with
scoop install crystal
powershell ./rsrc/native/windows/install.ps1
- Run in powershell
$env:LIB="${env:LIB};C:\raylib"
$env:PATH="${env:PATH};C:\raylib"
OR
Run in cmd
set PATH=%PATH%;C:\raylib
set LIB=%LIB%;C:\raylib
- Add
raylib-cr
to yourshard.yml
:
dependencies:
raylib-cr:
github: sol-vin/raylib-cr
- Run
shards install
- Get programming!
- Run
sudo sh rsrc/native/mac/mac-raylib-install.sh
- Add
raylib-cr
to yourshard.yml
:
dependencies:
raylib-cr:
github: sol-vin/raylib-cr
- Run
shards install
- Get programming!
main.cr
require "raylib-cr"
Raylib.init_window(800, 450, "Hello World")
Raylib.set_target_fps(60)
until Raylib.close_window?
Raylib.begin_drawing
Raylib.clear_background(Raylib::RAYWHITE)
Raylib.draw_text("Hello World!", 190, 200, 20, Raylib::BLACK)
Raylib.end_drawing
end
Raylib.close_window
- Add
raylib-cr
toshard.yml
dependencies. shards install
- Run in powershell (only needs to be run once per new console window opened)
$env:LIB="${env:LIB};C:\raylib"
$env:PATH="${env:PATH};C:\raylib"
shards run
If you need to extra functionality, RLGL, RAudio and Lights can be included with the following.
require "raylib-cr/raygui"
require "raylib-cr/rlgl"
require "raylib-cr/audio"
require "raylib-cr/lights"
- Fork it (https://github.com/sol-vin/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
- rightbrace - Raymath & Wrapper
- D. Shwagginz - RayGUI
- b1tlet - Fog Shader
- AregevDev - creator