Commit graph

306 commits

Author SHA1 Message Date
Ali Chraghi
c26cfec0b6 update to latest mach-core API 2023-08-02 20:34:15 -07:00
Stephen Gutekanst
095c7795ba editor: fix potential memory leak
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-22 18:50:16 -07:00
Stephen Gutekanst
835748a8c5 update to latest mach-core API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-21 23:35:24 -07:00
Stephen Gutekanst
c3e8c25f1d math: update to latest Zig version
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-21 20:29:40 -07:00
Stephen Gutekanst
c004ea1b06 sprite2d: use nearest texture filter + fix texture coloring
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-15 17:03:12 -07:00
Stephen Gutekanst
6a81c7a579 math: bless approximate equality by default
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-15 13:42:25 -07:00
Stephen Gutekanst
d354fd24c4 math: cleanup matrix initialization
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-15 13:42:25 -07:00
Stephen Gutekanst
d3f5ce1d98 math: cleanup docstrings
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-15 13:42:25 -07:00
RokKos
f9e727fa2d mach: math lib vector dot product 2023-07-15 13:42:25 -07:00
RokKos
9ec766c165 mach: math lib consistent function naming 2023-07-15 13:42:25 -07:00
RokKos
72e2df50a3 mach: math lib comment for cross product 2023-07-15 13:42:25 -07:00
RokKos
d87895eded mach: math lib added vector cross product function 2023-07-15 13:42:25 -07:00
RokKos
6c60f03386 mach: math lib adding const qualifier to set_2d_matrix 2023-07-15 13:42:25 -07:00
RokKos
6af918528c mach: math lib adding test for multiplication 2023-07-15 13:42:25 -07:00
RokKos
6a3720ba7d mach: math lib adding function to test if two matrix are equal and approximately equal 2023-07-15 13:42:25 -07:00
RokKos
becfd948e8 mach: math lib adding functionalities for setting 2d/3d matrix 2023-07-15 13:42:25 -07:00
RokKos
5f41195b68 mach: math lib added tests for matrix functionalities
including newly added functions rotateX and rotateY
2023-07-15 13:42:25 -07:00
RokKos
e96864242c mach: math lib added testing for vector functionalities 2023-07-15 13:42:25 -07:00
RokKos
507f07f72a mach: math lib added rotation for X and Y 2023-07-15 13:42:25 -07:00
Stephen Gutekanst
4c34a65020 editor: fold shaderexp into editor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-12 17:35:02 -07:00
Stephen Gutekanst
a3ec0fb7a9 editor: fix help commands
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-12 10:35:05 -07:00
Stephen Gutekanst
d72155df4c fold app/ into src/editor/
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-12 10:28:21 -07:00
Stephen Gutekanst
3d27836318 mach: atlas: add UV calculation helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-04 10:29:30 -07:00
Stephen Gutekanst
a1b4c03f9d mach: add mach.Atlas implementation from Mitchell Hashimoto
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-07-04 08:25:14 -07:00
Stephen Gutekanst
0e1b79969f mach: remove ResourceManager for now
needs much more thought

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-30 20:40:30 -07:00
Stephen Gutekanst
4bc32adeb8 all: update to latest Zig APIs (zig fmt)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-29 09:54:32 -07:00
Stephen Gutekanst
29964c99bb update to latest Zig (zig fmt)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-25 00:01:55 -07:00
Răzvan C. Rădulescu
7866d3fd10 mach: update gfx2d-Sprite2D with optional texture view 2023-06-13 09:54:46 -07:00
Julian Rachele
eefe74fc06
gfx2d: align Uniforms struct on 16 bytes (#805) 2023-06-13 09:53:46 -07:00
Stephen Gutekanst
816b5101b3 core: use mach-sysjs via package manager
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-19 08:21:31 -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
Stephen Gutekanst
a2d222072e mach: gfx2d: fix imports
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-17 20:38:10 -07:00
Stephen Gutekanst
8d2d31f6cb mach: add gfx2d / Sprite2D ECS module
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-17 20:34:28 -07:00
Stephen Gutekanst
03fe3d02a9 mach: add new mach.math module
https://machengine.org/next/engine/math/

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-17 20:32:57 -07:00
Stephen Gutekanst
1fbd36199a mach: depend on mach-ecs and mach-earcut standalone repositories
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-28 16:04:45 -07:00
Stephen Gutekanst
4ebf238c5e mach: use a minimal core App, with a module implementing everything
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
f41b1b4f7b mach: use type safe module wrapper/helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
353cf6144b mach: update to latest ECS module layout
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
85ffb37156 mach: handle exit via module globals
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
f153133c30 {mach,ecs}: pass World to ECS event handlers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
15e6f81df8 mach: prepare to handle ECS init via modules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
2879ad58b0 ecs: replace world.tick() with generic world.send(.tick) message passing
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
3ff4bcc2a3 mach: finish splitting Core and Engine
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-24 18:14:52 -07:00
Stephen Gutekanst
9bbada90b2 {mach,core}: move core sources to libs/core
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-24 18:14:52 -07:00
Ali Chraghi
192cacb85d mach: put logFn function to std_options 2023-01-20 14:53:22 -07:00
Stephen Gutekanst
0eaa56b4ad mach: platform/libmach: update to latest mach/core API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Stephen Gutekanst
a15b9bb5f6 mach: platform/wasm: correct return signature
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Stephen Gutekanst
8082228186 mach: eliminate heap allocation of Core
Prior to this change `mach.Core.init` would heap allocate the structure, returning `*Core`:

```zig
app.core = try mach.Core.init(allocator, .{});
```

This was obviously not ideal, but wasn't possible to eliminate before due to how Core was
entangled with the platform abstraction. Now that it has been removed, we can reduce Core
initialization to take a `*Core` to initialize. In practice this means initialization looks
something like this:

```zig
try mach.Core.init(&app.core, alloctor, .{});
```

Or more simply:

```zig
try app.core.init(allocator, .{});
```

And we eliminate the `*Core` allocation entirely in most cases.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Ali Chraghi
2fd8e876fd mach: re-create swapchain on vsync mode change 2023-01-15 09:45:17 -07:00
Ali Chraghi
10d5f344e3 {glfw,mach}: remove dead code 2023-01-15 08:31:26 -07:00