@bloomengine/engine 0.3.1 → 0.3.2
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 +33 -11
- package/native/linux/Cargo.lock +1571 -12
- package/native/linux/Cargo.toml +3 -0
- package/native/linux/src/lib.rs +745 -40
- package/native/macos/src/lib.rs +30 -118
- package/native/shared/build.rs +32 -4
- package/native/shared/src/postfx.rs +16 -10
- package/native/shared/src/renderer/formats.rs +1 -7
- package/native/shared/src/renderer/impulse_field.rs +2 -1
- package/native/shared/src/renderer/material_system.rs +15 -3
- package/native/shared/src/renderer/shaders.rs +7 -1
- package/native/shared/src/renderer/transient.rs +12 -12
- package/native/shared/src/string_header.rs +32 -0
- package/native/third_party/bloom_jolt/CMakeLists.txt +14 -5
- package/native/windows/Cargo.lock +1 -0
- package/native/windows/Cargo.toml +10 -1
- package/native/windows/src/lib.rs +226 -18
- package/package.json +8 -7
- package/src/core/colors.ts +34 -27
- package/src/core/index.ts +1 -2
package/README.md
CHANGED
|
@@ -5,11 +5,33 @@
|
|
|
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
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @bloomengine/engine
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or with your preferred package manager:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun add @bloomengine/engine
|
|
18
|
+
pnpm add @bloomengine/engine
|
|
19
|
+
yarn add @bloomengine/engine
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The npm package ships the TypeScript API alongside the engine's Rust sources and the bundled [JoltPhysics](https://github.com/jrouwe/JoltPhysics) C++ shim, so a single `install` is enough — there's no separate native download step.
|
|
23
|
+
|
|
24
|
+
You'll also need:
|
|
25
|
+
|
|
26
|
+
- **Perry** — the TypeScript AOT compiler that turns your game into a native binary or WASM module. It also drives the engine's native build.
|
|
27
|
+
- **Rust toolchain** ([rustup.rs](https://rustup.rs)) — Perry invokes Cargo to compile the engine's platform crate the first time you build for each target.
|
|
28
|
+
- For web builds only: [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) (`cargo install wasm-pack`).
|
|
29
|
+
|
|
8
30
|
## Quick Start
|
|
9
31
|
|
|
10
32
|
```typescript
|
|
11
33
|
import { initWindow, windowShouldClose, beginDrawing,
|
|
12
|
-
endDrawing, clearBackground, drawText, Colors } from "
|
|
34
|
+
endDrawing, clearBackground, drawText, Colors } from "@bloomengine/engine";
|
|
13
35
|
|
|
14
36
|
initWindow(800, 450, "My Game");
|
|
15
37
|
|
|
@@ -26,7 +48,7 @@ while (!windowShouldClose()) {
|
|
|
26
48
|
Use `runGame()` for code that works on both native and web:
|
|
27
49
|
|
|
28
50
|
```typescript
|
|
29
|
-
import { initWindow, runGame, clearBackground, drawText, Colors } from "
|
|
51
|
+
import { initWindow, runGame, clearBackground, drawText, Colors } from "@bloomengine/engine";
|
|
30
52
|
|
|
31
53
|
initWindow(800, 450, "My Game");
|
|
32
54
|
|
|
@@ -55,14 +77,14 @@ cd dist/web && python3 -m http.server 8080
|
|
|
55
77
|
|
|
56
78
|
| Module | Import | Description |
|
|
57
79
|
|--------|--------|-------------|
|
|
58
|
-
| **Core** |
|
|
59
|
-
| **Shapes** |
|
|
60
|
-
| **Textures** |
|
|
61
|
-
| **Text** |
|
|
62
|
-
| **Audio** |
|
|
63
|
-
| **Models** |
|
|
64
|
-
| **Math** |
|
|
65
|
-
| **Physics** |
|
|
80
|
+
| **Core** | `@bloomengine/engine/core` | Window, game loop, input, timing |
|
|
81
|
+
| **Shapes** | `@bloomengine/engine/shapes` | 2D drawing + collision detection |
|
|
82
|
+
| **Textures** | `@bloomengine/engine/textures` | Image loading, sprite batching |
|
|
83
|
+
| **Text** | `@bloomengine/engine/text` | TTF/OTF font loading and rendering |
|
|
84
|
+
| **Audio** | `@bloomengine/engine/audio` | Sound effects + music streaming |
|
|
85
|
+
| **Models** | `@bloomengine/engine/models` | 3D model loading (glTF, OBJ), skeletal animation |
|
|
86
|
+
| **Math** | `@bloomengine/engine/math` | Vectors, matrices, quaternions, easing |
|
|
87
|
+
| **Physics** | `@bloomengine/engine/physics` | Jolt-backed rigid + soft bodies, character, vehicles ([docs](docs/physics.md)) |
|
|
66
88
|
|
|
67
89
|
## Platforms
|
|
68
90
|
|
|
@@ -143,7 +165,7 @@ Bloom supports GPU-accelerated skeletal animation via glTF/GLB models. The pipel
|
|
|
143
165
|
|
|
144
166
|
```typescript
|
|
145
167
|
import { loadModel, loadModelAnimation, updateModelAnimation, drawModel,
|
|
146
|
-
getTime, Colors } from "
|
|
168
|
+
getTime, Colors } from "@bloomengine/engine";
|
|
147
169
|
|
|
148
170
|
const character = loadModel("assets/models/character.glb");
|
|
149
171
|
const anim = loadModelAnimation("assets/models/character.glb");
|