Commit graph

238 commits

Author SHA1 Message Date
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
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
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
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
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
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
b4a479fb3f module: basic event handler parameter validation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
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
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
23b03f973f module: make sendGlobal() global args type known
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
f3f4524f1b all: improve module event names, gfx.Sprite/gfx.Text init
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
15d9efcf26 module: *World is no longer an injectable parameter
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
aa33896935 gfx: make Text ECS module use style entities (cleaner API design)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-06 15:18:38 -07:00
Stephen Gutekanst
3898995c4c all: get ECS running on revised module system
All ECS `examples/` now run on the revised module system.

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
Stephen Gutekanst
189997c279 {mach,examples}: move examples to github.com/hexops/mach-examples
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-16 12:21:50 -07:00
Stephen Gutekanst
d5570d5a18 examples: document self-hosted compoiler bug
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 07:58:07 -07:00
Stephen Gutekanst
78cf48e022 examples: fix cubemap compilation
self-hosted compiler picked up alignment issues better.

fixes hexops/mach#578

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-14 11:20:47 -07:00
Ali Chraghi
288299b88b examples: make sure some structs has guaranteed in-memory layout 2022-10-11 00:59:23 +02:00
Ali Chraghi
8e012d02bb git: use stage2_compat branch for zigimg
slimsag/zigimg had pointless discard errors
2022-09-20 02:30:45 -07:00
Ali Chraghi
15dfb2867a all: rename setShouldClose to close
Closes #550
2022-09-18 09:50:15 -07:00
Diego Arias
eef76effe3 examples: add pixel post processing effect example 2022-09-16 16:49:20 -07:00
praschke
b0cd4ec1a0
all: fix pointless discards; typo; fix libmach compilation on Linux (#541) 2022-09-15 07:41:05 -07:00
praschke
a873227ab8 {mach,examples,shaderexp}: fix default minimum window size 2022-09-15 07:39:38 -07:00
NewbLuck
f15cea9492
examples: add cubemap example (#523)
Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
2022-09-09 22:41:24 -07:00
Louis Pearson
70f4514c66 sysaudio: fix compile for web 2022-09-09 22:39:35 -07:00
Louis Pearson
0e71daf504
{sysaudio,examples}: get sysaudio running on linux, separate audio configuration and descriptor (#518)
* Get sysaudio working on linux
* Separate audio configuration and descriptor
* Config/Descriptor -> Options/Properties
- Rename sysaudio DeviceConfig and DeviceDescriptor to Device.Options and Device.Properties
- example: Convert buffer before passing to renderWithType
* make Device.start() idempotent
2022-09-09 08:58:03 -07:00
Ali Chraghi
06b0609ada examples: add triangle-msaa 2022-09-07 21:25:35 -07:00
Stephen Gutekanst
1dc3a4cba8 {sysaudio,examples}: add support for multiple channels
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-28 23:37:56 -07:00
Stephen Gutekanst
587ea05d1e examples: add sysaudio piano example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-28 23:37:56 -07:00
Stephen Gutekanst
f094a85a1e examples/gkurve: fix compilation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 20:18:02 -07:00
Stephen Gutekanst
eb5149a7bb examples/gkurve: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 19:21:27 -07:00
Stephen Gutekanst
fd8153b231 examples: zigimg: switch to MasterQ32 stage2 patches
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 17:59:02 -07:00
Stephen Gutekanst
4199d2a001 all: clarify self-hosted compiler TODOs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 23:37:48 -07:00
Stephen Gutekanst
c4421840cb examples: improve compatibility with self-hosted compiler; zigimg updates
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 22:58:18 -07:00
Stephen Gutekanst
bc5e2fe9bf examples: workaround change in @embedFile not working with relative paths
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 22:48:19 -07:00
Stephen Gutekanst
37c3045314 examples: update zigimg usage
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 22:43:04 -07:00
Stephen Gutekanst
dc00067ec1 examples: update zigimg for self-hosted compatibility
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 22:40:21 -07:00
Stephen Gutekanst
a4ddfb6bda examples: make map-async compatible with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 13:17:52 -07:00
Stephen Gutekanst
0e14764ab2 examples: make advanced-gen-texture-light compatible with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-20 12:02:58 -07:00
Stephen Gutekanst
edc3b5d60e examples: use default values, gpu helper APIs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-17 01:42:27 -07:00