Rand Stats

Raylib::Bindings

zef:vushu

raylib-raku (Raylib::Bindings)

Autogenerated raylib-raku bindings, powered by raku grammar and actions.

Preface

To make Raku play together with Raylib, many of Raylib's functions has to be wrapped into a function, to support pass as pointer meaning we are "pointerizing" the functions. This is done automatically when generating the bindings. The bindings are also converted to kebab-case to fit Raku code style.

On installation:

Raylib::Bindings comes with support for malloc-ing Raylib structs,

Example the code below will allocate Color as a pointer.
my $white = Color.init(245, 245, 245, 255);

All struct/class in Raylib::Bindings are equipped with an init function,
which mallocs.
Manually calling free isn't necessary, since every struct/class are also equipped with a free on destroy mechanism and gets handled by the GC. Here is the DESTROY method of Color

submethod DESTROY {
    free-Color(self);
}

Prerequisite

install raylib from:

https://github.com/raysan5/raylib

Install

zef install Raylib::Bindings

Install from repository

git clone git@github.com:vushu/raylib-raku.git
cd raylib-raku 
zef install .

Examples

raku examples/window.raku
raku examples/flying-butterfly.raku
raku examples/rotating-butterfly.raku
raku examples/3d-camera.raku

More examples at

https://www.raylib.com/examples.html

Cheatsheet

https://www.raylib.com/cheatsheet/cheatsheet.html

Wiki

https://github.com/raysan5/raylib/wiki


Screenshots

Flying Camelia

Rotating Camelia

2d camera


Missing:

help is appreciated!