@dayme/bunraylib 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -11
- package/package.json +11 -3
- package/src/Raylib.ts +58 -3678
- package/src/c/common.h +0 -2
- package/src/constants.ts +2 -2
- package/src/index.ts +6 -6
- package/src/main.c +0 -1
- package/src/main.d.ts +1 -1
- package/src/modules/audio/AudioModule.ts +197 -0
- package/src/modules/audio/symbols.ts +70 -0
- package/src/{c/audio.c → modules/audio/wrapper.c} +40 -80
- package/src/modules/camera/CameraModule.ts +239 -0
- package/src/modules/camera/symbols.ts +49 -0
- package/src/modules/camera/wrapper.c +141 -0
- package/src/modules/collision/CollisionModule.ts +363 -0
- package/src/modules/collision/symbols.ts +149 -0
- package/src/modules/collision/wrapper.c +176 -0
- package/src/modules/color/ColorModule.ts +65 -0
- package/src/modules/color/symbols.ts +26 -0
- package/src/modules/color/wrapper.c +16 -0
- package/src/modules/draw3d/Draw3DModule.ts +441 -0
- package/src/modules/draw3d/symbols.ts +199 -0
- package/src/modules/draw3d/wrapper.c +202 -0
- package/src/modules/font/FontModule.ts +250 -0
- package/src/modules/font/symbols.ts +46 -0
- package/src/{c/font.c → modules/font/wrapper.c} +50 -70
- package/src/modules/image/ImageModule.ts +451 -0
- package/src/{symbols/image.ts → modules/image/symbols.ts} +15 -12
- package/src/{c/image.c → modules/image/wrapper.c} +23 -45
- package/src/modules/input/InputModule.ts +160 -0
- package/src/modules/input/symbols.ts +54 -0
- package/src/modules/input/wrapper.c +31 -0
- package/src/modules/model/ModelModule.ts +228 -0
- package/src/{symbols/model.ts → modules/model/symbols.ts} +17 -14
- package/src/{c/model.c → modules/model/wrapper.c} +30 -30
- package/src/modules/shader/ShaderModule.ts +78 -0
- package/src/{symbols/shader.ts → modules/shader/symbols.ts} +3 -1
- package/src/{c/shader.c → modules/shader/wrapper.c} +11 -1
- package/src/modules/shapes/ShapesModule.ts +687 -0
- package/src/modules/shapes/symbols.ts +161 -0
- package/src/modules/shapes/wrapper.c +183 -0
- package/src/modules/texture/TextureModule.ts +190 -0
- package/src/{symbols/texture.ts → modules/texture/symbols.ts} +15 -9
- package/src/{c/texture.c → modules/texture/wrapper.c} +7 -22
- package/src/modules/window/WindowModule.ts +248 -0
- package/src/modules/window/symbols.ts +85 -0
- package/src/modules/window/wrapper.c +39 -0
- package/src/symbols.ts +87 -47
- package/src/utils.ts +63 -15
- package/src/c/camera.c +0 -161
- package/src/c/collision.c +0 -176
- package/src/c/color.c +0 -100
- package/src/c/draw3d.c +0 -222
- package/src/c/filesystem.c +0 -36
- package/src/c/input.c +0 -85
- package/src/c/shapes.c +0 -283
- package/src/c/window.c +0 -150
- package/src/symbols/audio.ts +0 -64
- package/src/symbols/camera.ts +0 -46
- package/src/symbols/collision.ts +0 -116
- package/src/symbols/color.ts +0 -22
- package/src/symbols/draw3d.ts +0 -137
- package/src/symbols/filesystem.ts +0 -30
- package/src/symbols/font.ts +0 -40
- package/src/symbols/input.ts +0 -51
- package/src/symbols/shapes.ts +0 -92
- package/src/symbols/window.ts +0 -83
package/README.md
CHANGED
|
@@ -1,31 +1,80 @@
|
|
|
1
1
|
# rraylib
|
|
2
2
|
|
|
3
|
-
TypeScript FFI bindings for [raylib](https://www.raylib.com/) —
|
|
3
|
+
> TypeScript FFI bindings for [raylib](https://www.raylib.com/) — powered by [Bun](https://bun.sh/).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Zero external dependencies. The C wrappers are compiled on-the-fly via `bun ffi cc`, so all you need is Bun ≥1.3.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```bash
|
|
10
|
+
bun install @dayme/bunraylib
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Raylib, COLORS } from "@dayme/bunraylib";
|
|
17
|
+
|
|
18
|
+
Raylib.initWindow(800, 600, "Hello rraylib");
|
|
19
|
+
Raylib.setTargetFPS(60);
|
|
20
|
+
|
|
21
|
+
while (!Raylib.windowShouldClose()) {
|
|
22
|
+
Raylib.beginDrawing();
|
|
23
|
+
Raylib.clearBackground(COLORS.DARKGRAY);
|
|
24
|
+
Raylib.drawText("Hello World!", 350, 280, 20, COLORS.WHITE);
|
|
25
|
+
Raylib.endDrawing();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Raylib.closeWindow();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run it:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bun run main.ts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## API coverage
|
|
38
|
+
|
|
39
|
+
**494 / 496 functions implemented (99.6%)**
|
|
10
40
|
|
|
11
41
|
| Module | Progress |
|
|
12
42
|
| --- | --- |
|
|
13
|
-
| Window and Graphics Device |
|
|
43
|
+
| Window and Graphics Device | 97/99 (98%) |
|
|
14
44
|
| Input Handling | 37/37 (100%) |
|
|
15
45
|
| Gestures and Touch | 8/8 (100%) |
|
|
16
46
|
| Camera System | 2/2 (100%) |
|
|
17
|
-
| Shapes Drawing |
|
|
47
|
+
| Shapes Drawing | 69/69 (100%) |
|
|
18
48
|
| Texture Loading and Drawing | 112/112 (100%) |
|
|
19
|
-
| Font Loading and Text Drawing |
|
|
49
|
+
| Font Loading and Text Drawing | 37/37 (100%) |
|
|
20
50
|
| Basic 3D Shapes | 21/21 (100%) |
|
|
21
|
-
| Model Loading and Drawing |
|
|
22
|
-
| Audio Loading and Playing |
|
|
51
|
+
| Model Loading and Drawing | 50/50 (100%) |
|
|
52
|
+
| Audio Loading and Playing | 61/61 (100%) |
|
|
23
53
|
|
|
24
54
|
Full breakdown: [PROGRESS.md](./PROGRESS.md)
|
|
25
55
|
|
|
26
|
-
##
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
Explore the [`examples/`](./examples) directory:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun run examples/shapes.ts # 2D shapes
|
|
62
|
+
bun run examples/shapes3d.ts # 3D primitives
|
|
63
|
+
bun run examples/textures.ts # Textures & render targets
|
|
64
|
+
bun run examples/models.ts # GLB model viewer
|
|
65
|
+
bun run examples/audio.ts # Sound & music
|
|
66
|
+
bun run examples/index.ts # Input, window & clipboard demo
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Requirements
|
|
70
|
+
|
|
71
|
+
- [Bun](https://bun.sh/) ≥ 1.3
|
|
72
|
+
|
|
73
|
+
## Development
|
|
27
74
|
|
|
28
75
|
```bash
|
|
29
76
|
bun install
|
|
30
|
-
bun run
|
|
77
|
+
bun test # run all tests
|
|
78
|
+
bun run lint # oxlint
|
|
79
|
+
bun run progress # regenerate PROGRESS.md
|
|
31
80
|
```
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dayme/bunraylib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "TypeScript FFI bindings for raylib — zero dependencies, powered by Bun",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"raylib",
|
|
7
|
+
"ffi",
|
|
8
|
+
"bun",
|
|
9
|
+
"gamedev",
|
|
10
|
+
"graphics"
|
|
11
|
+
],
|
|
6
12
|
"license": "MIT",
|
|
7
13
|
"type": "module",
|
|
8
14
|
"module": "src/index.ts",
|
|
@@ -27,8 +33,10 @@
|
|
|
27
33
|
"@types/bun": "^1.3.11"
|
|
28
34
|
},
|
|
29
35
|
"devDependencies": {
|
|
36
|
+
"fast-check": "^4.8.0",
|
|
30
37
|
"oxfmt": "^0.43.0",
|
|
31
|
-
"oxlint": "^1.58.0"
|
|
38
|
+
"oxlint": "^1.58.0",
|
|
39
|
+
"oxlint-tsgolint": "^0.23.0"
|
|
32
40
|
},
|
|
33
41
|
"peerDependencies": {
|
|
34
42
|
"typescript": "^5"
|