Commit graph

3468 commits

Author SHA1 Message Date
Stephen Gutekanst
f1dbc3955c audio: cleanup audio module
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 11:48:15 -07:00
Ali Chraghi
be3300b80a audio: add audio mixing/playback module 2024-04-16 10:50:59 -07:00
Stephen Gutekanst
b0d6c88f3b audio: reduce alsa and pulseaudio latency to 30ms
Closes #928

Change contributed by Ali in https://github.com/hexops/mach/pull/1138
I am just cleaning up the commit.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 10:48:00 -07:00
Stephen Gutekanst
74595362d3 gfx: add some Text module TODOs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 10:41:32 -07:00
Stephen Gutekanst
b90b70084e examples: glyphs: improve code structure / naming / init logic
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 10:40:36 -07:00
Stephen Gutekanst
8e3f9e21e1 module: add MACH_DEBUG_TRACE option to get logs of event dispatch order
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 10:39:35 -07:00
Stephen Gutekanst
16a895240d gfx: improve Sprite module pipeline management
* No longer abuse event arguments for pipeline information.
* Store pipeline information as entities/components.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 10:10:37 -07:00
Stephen Gutekanst
5714a60108 gfx: split text style entity components into a distinct module
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-15 02:42:07 -07:00
Stephen Gutekanst
2cf68adcc7 src/gpu: move github.com/hexops/mach-gpu here
This moves github.com/hexops/mach-gpu@528dad0823dafeae5d474c88cc658b091bf2e605 to
this repository in the src/gpu directory. It can be imported via `@import("mach").gpu`.

Soon we will move away from mach-gpu entirely as part of #1166 - but in the meantime
I am giving a workshop at https://sycl.it and it would be nice for people using the
`mach.gpu.*` API to be able to search the API in this single repository.

There's not much harm to moving this code here.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-13 11:25:45 -07:00
Ali Chraghi
c45606c290 sysaudio: disable i24 sample format
Workaround for #1152
2024-04-13 07:25:39 -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
3583e1754f core: add a TODO regarding module API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-09 18:53:18 -07:00
TheHonestHare
f369b31137 added swap chain usage flags to core.init() options 2024-04-08 23:54:43 -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
013546b189 core: add mach.Core module API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-08 23:49:38 -07:00
Stephen Gutekanst
69b749879d core: refactor glfw appUpdateThread
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-08 23:49:38 -07:00
Stephen Gutekanst
c32c1df00a module: improve validation of missing mod name
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-08 23:49:38 -07:00
Stephen Gutekanst
c46d949b98 module: improve "cannot inject argument" error message
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-07 22:37:59 -07:00
Stephen Gutekanst
9cfbe86b0f module: fix missing injected argument check
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-07 13:58:02 -07:00
Stephen Gutekanst
fda017663a mach: keep module types closer together
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-07 13:55:08 -07:00
Stephen Gutekanst
393a3e5e5e module: add check for missing injected arguments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-07 13:54:46 -07:00
Stephen Gutekanst
34030faa9d module: fix local_events validation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-07 13:54:26 -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
679a05faf4 ecs: refactor comptime.zig -> Archetype.zig
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
af3c1e9155 module: remove dispatchNoError, better loop implementation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
5737c62171 engine: minor App event sending cleanup
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
56c16798cd engine: fix local event sending
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
5812409078 module: document loop intention, fix test
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
95331ebf8f module: basic event docs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
4b9379707c module: cleanup TODOs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
0148b931ca module: make sendToModule the default name for sending events
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
5dbf9ece3b module: do not expose list of modules
Doing so would encourage accidentally creating dependency loops.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
b4a479fb3f module: basic event handler parameter validation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Dustin Taylor
92a9836c61 ECS: @memcpy Overlap Memory Bug Fix 2024-04-06 15:18:38 -07:00
Stephen Gutekanst
3ea64966f0 module: remove TupleHACK now that dependency loop is resolved
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
b3663f7899 module: enable Module to analyze event handler signatures
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
ce0b764a6d ecs: check column type IDs before size/alignment
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
582a3c07f6 module: elevate local/global args type construction
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
8711e5e3a7 module: rename MComponentTypes -> ComponentTypesM (consistency with LocalArgsM, etc.)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
e6a170a07a module: remove NamespacedState; module state is literally its struct type
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
17c751a2e7 module: improve variable naming slightly
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
f55aee4b50 module: rename MComponents -> MComponentTypes
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
a83f9d5be8 module: rename NamespacedComponents -> ComponentTypesByName
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00