@dayme/bunraylib
v1.0.1
Published
TypeScript FFI bindings for raylib — zero dependencies, powered by Bun
Downloads
54
Readme
rraylib
Zero external dependencies. The C wrappers are compiled on-the-fly via bun ffi cc, so all you need is Bun ≥1.3.
Install
bun install @dayme/bunraylibQuick start
import { Raylib, COLORS } from "@dayme/bunraylib";
Raylib.initWindow(800, 600, "Hello rraylib");
Raylib.setTargetFPS(60);
while (!Raylib.windowShouldClose()) {
Raylib.beginDrawing();
Raylib.clearBackground(COLORS.DARKGRAY);
Raylib.drawText("Hello World!", 350, 280, 20, COLORS.WHITE);
Raylib.endDrawing();
}
Raylib.closeWindow();Run it:
bun run main.tsAPI coverage
502 / 502 targetable functions implemented (100%) — 98 raylib functions are intentionally skipped (C-only APIs: filesystem I/O, raw memory/pointer helpers, C-string utilities, crypto/compression — JS has native equivalents).
| Module | Progress | | --- | --- | | Window and Graphics Device | 101/101 (100%) | | Input Handling | 39/39 (100%) | | Gestures and Touch | 8/8 (100%) | | Camera System | 2/2 (100%) | | Shapes Drawing | 69/69 (100%) | | Texture Loading and Drawing | 112/112 (100%) | | Font Loading and Text Drawing | 37/37 (100%) | | Basic 3D Shapes | 21/21 (100%) | | Model Loading and Drawing | 51/51 (100%) | | Audio Loading and Playing | 62/62 (100%) |
Full breakdown: PROGRESS.md
Examples
Explore the examples/ directory:
bun run examples/shapes.ts # 2D shapes
bun run examples/shapes3d.ts # 3D primitives
bun run examples/textures.ts # Textures & render targets
bun run examples/models.ts # GLB model viewer
bun run examples/audio.ts # Sound & music
bun run examples/index.ts # Input, window & clipboard demoRequirements
- Bun ≥ 1.3
Development
bun install
bun test # run all tests
bun run lint # oxlint
bun run progress # regenerate PROGRESS.md