Commit graph

36 commits

Author SHA1 Message Date
Stephen Gutekanst
431e0dbbe1 {gfx,examples}: use core.state().queue
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
79dccb4d73 {gfx,examples}: use core.state().device
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
d2179e8f2c gfx: correct some zls autofixes
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-18 21:04:43 -07:00
Stephen Gutekanst
87a7cd8ed8 engine: remove mach.Engine in favor of mach.Core for now
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-17 11:30:51 -07:00
Stephen Gutekanst
d045b34f70 {gfx,examples}: update all to new mach.Core module API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-17 11:27:48 -07:00
Stephen Gutekanst
3d8c28a361 all: rename parameters foo_mod -> foo
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 19:14:37 -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
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
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
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
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
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
f29b775b27 mach-core moves back into the main repository
Helps hexops/mach#1165

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-03-05 00:22:22 -07:00
Stephen Gutekanst
221364415e mach-ecs moves back into the main repository
Helps hexops/mach#1165

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-03-05 00:22:22 -07:00
Stephen Gutekanst
89622810f8 all: use mach.math instead of std.math; fixes hexops/mach#1021
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-01-18 22:34:12 -07:00
Stephen Gutekanst
b5531f84cb update to Zig 2024.1.0-mach
Related to hexops/mach#1145

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-01-14 19:11:20 -07:00
Stephen Gutekanst
fc24a1148a gfx: use Mat4x4.projection2D once again
Helps hexops/mach#1103

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-01-06 13:11:23 -07:00
Stephen Gutekanst
260802f777 all: update ECS Mod(.module_tag) -> Mod(ModuleType)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-12-16 22:56:46 -07:00
Stephen Gutekanst
8ff30c931f all: update to global vs. local ECS change
See hexops/mach-ecs@ef06fb6473

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-12-16 19:41:34 -07:00
Stephen Gutekanst
e1ce5c5662 gfx: individual styles for text segments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-13 19:27:29 -07:00
Stephen Gutekanst
1f8962408c gfx: integrate new font stack into Text module
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:36 -07:00
Stephen Gutekanst
34259ed1b8 gfx: font: account for glyph bearings
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:33 -07:00
Stephen Gutekanst
dfbf3e3603 gfx: font: add glyph rendering functionality
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:30 -07:00
Stephen Gutekanst
87c3de78f5 gfx: font: begin adding text shaping via harfbuzz
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:13 -07:00
Stephen Gutekanst
3bcbdc4682 move mach.Atlas -> mach.gfx.Atlas
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-03 22:36:44 -07:00
Jeremia Dominguez
06f66d7a32 text: Fixed atlas finding glyphs of wrong size
Signed-off-by: Jeremia Dominguez <me@jeremia.dev>
2023-10-03 19:46:52 -07:00
Stephen Gutekanst
c16cddd250 all: refactor: cleanup module structure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-22 08:24:16 -07:00
Grant Morris
33e27d9bf1
mach: fix deprecated mem.set() call (#770)
Updating to the @memset builtin fixes the cubemap and pbr-basic examples
assuming zigimg is also up to date

mem.set() appears to have been deprecated -
2023-05-18 20:49:42 -07:00
Keith Chambers
c151222011
mach: VertexWriter fixes (#633)
* mach: VertexWriter fixes
* mach: Reference decls in gfx
* remove comptime block from refAllDecls as is redundant
2022-11-30 09:27:00 -07:00
Keith Chambers
f331597bc2
mach: gfx: Add VertexWriter (#630) 2022-11-28 22:29:50 -07:00