ahmedqarmout2/raylib-jai

Jai bindings for Raylib

46

stars

180

commits

C

primary language

Sep 7, 2026

updated

gamedev
jai
raygui
raylib
raylib-jai
Browse cluster: Raylib language bindings and wrappers

README

raylib-jai bindings

Raylib is a minimal gamedev library for C and this repository has a script for automatically generating Jai bindings from raylib.h, raymath.h, rcamera.h, rlgl.h and raygui.h.

Tested with Jai version: beta 0.2.030

Raylib version: 6.0

Raygui version: 5.0

Features

  • Windows, linux and macos support

  • Raygui support

  • Some functions which take enum arguments (like SetConfigFlags for example) have their argument types changed from C's int (or Jai's s32) to the actual enum type. Consequently, you can call them like SetConfigFlags(.FLAG_FULLSCREEN_MODE);

  • An additional set of macros lets you change any of the Begin/End function call pairs (like BeginMode3D(camera) and EndMode3D()) into an equivalent PushMode3D(camera) which will insert an automatic defer EndXXX() call into the scope for you.

Examples

Direct Jai ports for the following:

There are more than shown here ported in the examples and games folders.

Minimal example

Copy raylib directory into your libs directory. For example:

my_game/

.... libs/

.... .... raylib

.... main.jai
// main.jai
#import "raylib";

main :: () {
    InitWindow(800, 450, "raylib example");
    defer CloseWindow();

    while !WindowShouldClose() {
        BeginDrawing();
        defer EndDrawing();

        ClearBackground(RAYWHITE);
        DrawText("raylib + jai", 190, 200, 20, LIGHTGRAY);
    }
}

Compile using (on Windows): jai -import_dir .\libs .\main.jai

Compile the examples

jai generate.jai - --compile_all_examples

Regenerating the bindings

jai generate.jai

(Optional) Regenerate raygui lib files

jai generate.jai - --build_raygui

For more information

jai generate.jai - -h

Contributors

ahmedqarmout2

145 commits

kevinw

27 commits

kujukuju

8 commits

ahmedqarmout2/raylib-jai

Jai bindings for Raylib

46

stars

180

commits

C

primary language

Sep 7, 2026

updated

gamedev
jai
raygui
raylib
raylib-jai
Browse cluster: Raylib language bindings and wrappers

README

raylib-jai bindings

Raylib is a minimal gamedev library for C and this repository has a script for automatically generating Jai bindings from raylib.h, raymath.h, rcamera.h, rlgl.h and raygui.h.

Tested with Jai version: beta 0.2.030

Raylib version: 6.0

Raygui version: 5.0

Features

  • Windows, linux and macos support

  • Raygui support

  • Some functions which take enum arguments (like SetConfigFlags for example) have their argument types changed from C's int (or Jai's s32) to the actual enum type. Consequently, you can call them like SetConfigFlags(.FLAG_FULLSCREEN_MODE);

  • An additional set of macros lets you change any of the Begin/End function call pairs (like BeginMode3D(camera) and EndMode3D()) into an equivalent PushMode3D(camera) which will insert an automatic defer EndXXX() call into the scope for you.

Examples

Direct Jai ports for the following:

There are more than shown here ported in the examples and games folders.

Minimal example

Copy raylib directory into your libs directory. For example:

my_game/

.... libs/

.... .... raylib

.... main.jai
// main.jai
#import "raylib";

main :: () {
    InitWindow(800, 450, "raylib example");
    defer CloseWindow();

    while !WindowShouldClose() {
        BeginDrawing();
        defer EndDrawing();

        ClearBackground(RAYWHITE);
        DrawText("raylib + jai", 190, 200, 20, LIGHTGRAY);
    }
}

Compile using (on Windows): jai -import_dir .\libs .\main.jai

Compile the examples

jai generate.jai - --compile_all_examples

Regenerating the bindings

jai generate.jai

(Optional) Regenerate raygui lib files

jai generate.jai - --build_raygui

For more information

jai generate.jai - -h

Contributors

ahmedqarmout2

145 commits

kevinw

27 commits

kujukuju

8 commits

Languages

C

76.4%

Jai

23.6%