Skip to content

rishavs/raylib-cr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

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. raymath functions are also supported, as are infix operators for vectors, matricies, and quaternions. We also have physac and raygui support built in.

Supported platforms

These platforms are supported out of the box and are linked statically

  1. x86_64-linux-gnu = 64-bit Linux
  2. x86_64-windows = 64-bit Windows

Installation

Linux

  1. Install raylib from github
  2. Run make install in raylib
  3. Add raylib-cr to your shard.yml:
dependencies:
  raylib-cr:
    github: sol-vin/raylib-cr
  1. Run shards install
  2. Get programming!

Windows

  1. Install crystal with scoop install crystal
  2. Copy ./rsrc/native/windows/raylib to C:\raylib
  3. Run in powershell
$env:LIB="${env:LIB};C:\raylib\lib"
$env:PATH="${env:PATH};C:\raylib\lib"
  1. Run in cmd
set PATH=%PATH%;C:\raylib\lib
set LIB=%LIB%;C:\raylib\lib
  1. Go back to your project directory. Add raylib-cr to your shard.yml:
dependencies:
  raylib-cr:
    github: sol-vin/raylib-cr
  1. Run mkdir lib && cd lib && git clone https://github.com/sol-vin/raylib-cr
  2. Get programming!

Usage Example

require "raylib-cr"

LibRaylib.init_window(800, 450, "Hello World")
LibRaylib.set_target_fps(60)

until LibRaylib.close_window?
  LibRaylib.begin_drawing
  LibRaylib.clear_background(LibRaylib::RAYWHITE)
  
  LibRaylib.draw_text("Hello World!", 190, 200, 20, LibRaylib::BLACK)
  LibRaylib.end_drawing
end

LibRaylib.close_window

Contributing

  1. Fork it (https://github.com/sol-vin/raylib-cr)
  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

Inactive Contributors

About

LibRaylib Bindings for Crystal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 85.8%
  • Crystal 14.2%