@bloomengine/engine 0.4.3 → 0.4.4
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 +23 -2
- package/native/ios/Cargo.toml +8 -0
- package/native/macos/Cargo.toml +8 -0
- package/native/tvos/Cargo.toml +8 -0
- package/package.json +2 -2
- package/src/core/colors.ts +2 -2
package/README.md
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
Write TypeScript. Ship native games — and now the web too.
|
|
6
6
|
Bloom compiles your game to Metal, DirectX 12, Vulkan, OpenGL, and WebGPU — one codebase for every platform.
|
|
7
7
|
|
|
8
|
+
> **Inspired by [raylib](https://github.com/raysan5/raylib).** Bloom models its public
|
|
9
|
+
> API on raylib's — in our view one of the best API designs in gamedev. Bloom is an
|
|
10
|
+
> independent implementation, not a port — [how Bloom relates to raylib »](#how-bloom-relates-to-raylib)
|
|
11
|
+
|
|
8
12
|
## Install
|
|
9
13
|
|
|
10
14
|
```bash
|
|
@@ -37,7 +41,7 @@ initWindow(800, 450, "My Game");
|
|
|
37
41
|
|
|
38
42
|
while (!windowShouldClose()) {
|
|
39
43
|
beginDrawing();
|
|
40
|
-
clearBackground(Colors.
|
|
44
|
+
clearBackground(Colors.SNOW);
|
|
41
45
|
drawText("Hello, Bloom!", 190, 200, 20, Colors.DARKGRAY);
|
|
42
46
|
endDrawing();
|
|
43
47
|
}
|
|
@@ -53,7 +57,7 @@ import { initWindow, runGame, clearBackground, drawText, Colors } from "@bloomen
|
|
|
53
57
|
initWindow(800, 450, "My Game");
|
|
54
58
|
|
|
55
59
|
runGame((dt) => {
|
|
56
|
-
clearBackground(Colors.
|
|
60
|
+
clearBackground(Colors.SNOW);
|
|
57
61
|
drawText("Hello, Bloom!", 190, 200, 20, Colors.DARKGRAY);
|
|
58
62
|
});
|
|
59
63
|
```
|
|
@@ -73,6 +77,23 @@ cd dist/web && python3 -m http.server 8080
|
|
|
73
77
|
- **Unified 2D/3D** — Shapes, textures, text, 3D models, and audio in one engine.
|
|
74
78
|
- **Zero magic** — Explicit game loops, no hidden framework overhead.
|
|
75
79
|
|
|
80
|
+
## How Bloom relates to raylib
|
|
81
|
+
|
|
82
|
+
Bloom's public API is heavily inspired by [raylib](https://github.com/raysan5/raylib).
|
|
83
|
+
raylib's API is, in our opinion, one of the best in the gamedev space — a flat library
|
|
84
|
+
of plain functions, no classes, small enough to learn from a cheatsheet — so we model
|
|
85
|
+
ours on it. You'll recognize the shape immediately: `initWindow`, `beginDrawing`,
|
|
86
|
+
`clearBackground`, `drawText`, and modules named core / shapes / textures / text /
|
|
87
|
+
audio / models.
|
|
88
|
+
|
|
89
|
+
That's where the relationship ends. **Bloom's implementation is entirely independent —
|
|
90
|
+
it does not link against, embed, or call raylib.** Bloom compiles TypeScript directly to
|
|
91
|
+
native code via Perry, our LLVM-based AOT compiler, and renders through wgpu (Metal,
|
|
92
|
+
DirectX 12, Vulkan, OpenGL, WebGPU). It is not a port or a binding — just an engine that
|
|
93
|
+
admires raylib's API design. Thanks to
|
|
94
|
+
[Ramon Santamaria (@raysan5)](https://github.com/raysan5) and the raylib community for
|
|
95
|
+
setting the bar. ([full design rationale](docs/design-api.md))
|
|
96
|
+
|
|
76
97
|
## Modules
|
|
77
98
|
|
|
78
99
|
| Module | Import | Description |
|
package/native/ios/Cargo.toml
CHANGED
|
@@ -11,6 +11,14 @@ crate-type = ["staticlib"]
|
|
|
11
11
|
default = ["jolt"]
|
|
12
12
|
jolt = ["bloom-shared/jolt"]
|
|
13
13
|
|
|
14
|
+
# Match perry-runtime's panic strategy so the final perry-driven link
|
|
15
|
+
# doesn't see two copies of rust_eh_personality (and friends) from two
|
|
16
|
+
# independent Rust staticlibs. ld64.lld flags these as duplicate symbols;
|
|
17
|
+
# GNU ld silently tolerates them, which is why only Apple targets break.
|
|
18
|
+
# Mirrors the same setting in native/watchos/Cargo.toml.
|
|
19
|
+
[profile.release]
|
|
20
|
+
panic = "abort"
|
|
21
|
+
|
|
14
22
|
[dependencies]
|
|
15
23
|
bloom-shared = { path = "../shared", default-features = false, features = ["mp3"] }
|
|
16
24
|
objc2 = "0.6"
|
package/native/macos/Cargo.toml
CHANGED
|
@@ -15,6 +15,14 @@ crate-type = ["staticlib"]
|
|
|
15
15
|
default = ["jolt"]
|
|
16
16
|
jolt = ["bloom-shared/jolt"]
|
|
17
17
|
|
|
18
|
+
# Match perry-runtime's panic strategy so the final perry-driven link
|
|
19
|
+
# doesn't see two copies of rust_eh_personality (and friends) from two
|
|
20
|
+
# independent Rust staticlibs. ld64.lld flags these as duplicate symbols;
|
|
21
|
+
# GNU ld silently tolerates them, which is why only Apple targets break.
|
|
22
|
+
# Mirrors the same setting in native/watchos/Cargo.toml.
|
|
23
|
+
[profile.release]
|
|
24
|
+
panic = "abort"
|
|
25
|
+
|
|
18
26
|
[dependencies]
|
|
19
27
|
bloom-shared = { path = "../shared", default-features = false, features = ["mp3"] }
|
|
20
28
|
image = { version = "0.25", default-features = false, features = ["hdr"] }
|
package/native/tvos/Cargo.toml
CHANGED
|
@@ -11,6 +11,14 @@ crate-type = ["staticlib"]
|
|
|
11
11
|
default = ["jolt"]
|
|
12
12
|
jolt = ["bloom-shared/jolt"]
|
|
13
13
|
|
|
14
|
+
# Match perry-runtime's panic strategy so the final perry-driven link
|
|
15
|
+
# doesn't see two copies of rust_eh_personality (and friends) from two
|
|
16
|
+
# independent Rust staticlibs. ld64.lld flags these as duplicate symbols;
|
|
17
|
+
# GNU ld silently tolerates them, which is why only Apple targets break.
|
|
18
|
+
# Mirrors the same setting in native/watchos/Cargo.toml.
|
|
19
|
+
[profile.release]
|
|
20
|
+
panic = "abort"
|
|
21
|
+
|
|
14
22
|
[dependencies]
|
|
15
23
|
bloom-shared = { path = "../shared", default-features = false, features = ["mp3"] }
|
|
16
24
|
objc2 = "0.6"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloomengine/engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Bloom Engine: native TypeScript game engine compiled by Perry",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
},
|
|
537
537
|
"linux": {
|
|
538
538
|
"crate": "native/linux/",
|
|
539
|
-
"lib": "
|
|
539
|
+
"lib": "libbloom_linux.a",
|
|
540
540
|
"libs": ["stdc++"],
|
|
541
541
|
"pkgConfig": ["x11", "xi", "alsa"]
|
|
542
542
|
},
|
package/src/core/colors.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Color as ColorType } from './types';
|
|
|
5
5
|
// emits a `_perry_fn_src_core_colors_ts__Color` symbol that examples
|
|
6
6
|
// importing `Color` from `bloom/core` can link against.
|
|
7
7
|
export const Color: Record<string, ColorType> = {
|
|
8
|
-
|
|
8
|
+
Snow: { r: 245, g: 245, b: 245, a: 255 },
|
|
9
9
|
White: { r: 255, g: 255, b: 255, a: 255 },
|
|
10
10
|
Black: { r: 0, g: 0, b: 0, a: 255 },
|
|
11
11
|
Red: { r: 230, g: 41, b: 55, a: 255 },
|
|
@@ -58,6 +58,6 @@ export const Colors: Record<string, ColorType> = {
|
|
|
58
58
|
BEIGE: Color.Beige,
|
|
59
59
|
MAGENTA: Color.Magenta,
|
|
60
60
|
VIOLET: Color.Violet,
|
|
61
|
-
|
|
61
|
+
SNOW: Color.Snow,
|
|
62
62
|
BLANK: Color.Blank,
|
|
63
63
|
};
|