Commit graph

31 commits

Author SHA1 Message Date
Stephen Gutekanst
6feaad630e {examples,Audio}: optimize needless setComponent calls away
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
bd655828e3 all: use new mach.Entity.Mod query API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
541ce9e7c0 all: rename mach.Entity.Mod -> mach.Entities.Mod
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
65e2168b9f module: injected mach.Entity.Mod for global entity operations
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
69ff2e027f all: rename mod.entities -> mod.__entities (private)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
2e8926d6fa module: rename query -> queryDeprecated
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
ca08255ec2 {gfx,examples}: fix refcounting bugs, improve sysgpu compatability
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
cbf066ade5 {gfx,examples}: improve sysgpu compatibility with higher-level examples
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
15fd2c3a64 Core: use an explicit .start event sent by app to begin .tick events
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
fc0ff2fffd all: rename local_events -> events
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
136c86e929 examples: fix/improve custom-renderer example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
2c8ba82aa3 Core: use .app local init/deinit/tick events (avoid global events)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
fb37f74d41 examples: rename main modules -> App
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
4a000c7995 {Core,examples}: add TODO markers for core APIs that require module exposure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
03a089610b Core: store framebuffer information as components
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
656b0202f2 Core: add .present_frame event replacing swapbuffers call
Note that on e.g. web platform, swapbuffers is not an explicit call.
We also need a signal that the frame has been submitted and finished,
and this is it.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
bffc668005 {gfx,examples}: add labels to gpu objects
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-21 20:29:14 -07:00
Stephen Gutekanst
d1c3d26710 core: provide a default pub const GPUInterface
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-09 21:20:48 -07:00
Stephen Gutekanst
27fd19271c examples: migrate custom-renderer to mach.Core module API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-08 23:49:38 -07:00
Stephen Gutekanst
f578e1f5e2 {module,ecs}: Mach ECS becomes the Mach' module system
This moves the bulk of the ECS code into `src/module`. It also makes
types like `mach.ecs.EntityID` accessible at the top-level `mach.EntityID`
instead.

The motivation of this change is to make the Mach module system a
first-class property of Mach.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
883a9a7807 examples: add some TODOs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
a7a6ecdd45 examples/custom-renderer: correct packed struct -> extern struct
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
8bd822c35d examples/custom-renderer: minor docs improvement
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
5659dd6266 examples/custom-renderer: cleanup docs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
cf883f5544 module: change state to avoid undefined, remove global allocator
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
2115f5832a module: write components using a struct pattern
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
17db5498ee module: write module events using a struct pattern
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
7e0b9dde68 module: components are written in the same style as events
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
3bfafe102d module: event handlers are defined ahead of time
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
03454decdf examples: try send() -> send()
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
0a8e22bb49 examples: import mach-examples@20ceb359231ff284cf343dddba8cf25112ffe717
Helps hexops/mach#1165

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-03-06 11:08:19 -07:00