Commit graph

59 commits

Author SHA1 Message Date
Ronald M Zielaznicki
355dd53857 change(Core): deinit platform after GPU backend release 2024-10-25 12:21:24 -07:00
Ronald M Zielaznicki
404cf1c42a add(Core.zig): call to deviceTick after platform update 2024-10-20 21:40:02 -07:00
Joshua Holmes
88d14b5c04 core: get wayland to compile 2024-09-17 10:59:30 -07:00
Hordur Johannsson
d7d8029523
core: add more keys to Key enum (#1262) 2024-08-31 13:24:36 -07:00
Stephen Gutekanst
cd5cad696d core: fix process exit status code
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-27 21:26:41 -07:00
Stephen Gutekanst
9a940f2879 core: clarify allocator is internal state
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 19:24:35 -07:00
Stephen Gutekanst
f548918e13 core: move linux-specific code to Linux.zig
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 19:04:37 -07:00
Stephen Gutekanst
cd85a2d623 core: basic Linux structure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 19:00:22 -07:00
Stephen Gutekanst
c66cd31b99 core: move types to bottom of Core.zig
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 18:54:55 -07:00
Stephen Gutekanst
8447654311 core: move input state tracking from Platform to Core
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 18:50:32 -07:00
Stephen Gutekanst
1c0434a948 core: remove verbose comments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 18:21:21 -07:00
Stephen Gutekanst
09d39fb694 core: simplify event iterator
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 16:51:16 -07:00
Stephen Gutekanst
2eac60caf1 core: centralize EventQueue and EventIterator declaration
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 16:04:25 -07:00
Stephen Gutekanst
1fab277bf7 core: remove unimplemented joystick API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 15:57:18 -07:00
Stephen Gutekanst
470a84909b core: more code refactoring / improvements
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 15:45:43 -07:00
Stephen Gutekanst
de1275dc0a core: refactor code structure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 15:38:13 -07:00
Stephen Gutekanst
133c89638b all: move mach.Timer, core Timer/Frequency to mach.time module
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 14:24:09 -07:00
Stephen Gutekanst
301a8df8f9 remove unmaintained WASM support
Same reasoning as #1254

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 13:35:16 -07:00
Stephen Gutekanst
c2767b4e01 core: fix build with Null backend
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 11:52:36 -07:00
Hordur Johannsson
13e53e7176 Fixing core to work with win32 #1257 2024-08-25 09:59:08 -07:00
Stephen Gutekanst
17450fde65 core: remove linux support
The `mach.Core` API needs major design changes, and every backend that it supports
today must be updated to account for those API design changes. Unless someone is
actively maintaining and improving the state of a given backend, it slows down our
ability to make those critical changes.

Unfortunately, the backends for X11 and Wayland today are half-baked, nobody is
actively maintaining on or contributing to them, and the Linux CI tests have been
broken for over a month as a result which harms overall stability of Mach.

As a result, this PR removes Linux support from `mach.Core`

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-24 23:42:37 -07:00
Stephen Gutekanst
984d4de3bd
core: win32: various improvements (#1255)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Authored-by: Hordur Johannsson <hordurj@gmail.com>
2024-08-24 23:16:53 -07:00
Stephen Gutekanst
a5a3d31411 core: remove WASM support
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-24 22:33:15 -07:00
Stephen Gutekanst
642cc9b7f7 make it clear how to use module system without mach.Core (remove mach.App)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-24 22:33:15 -07:00
Stephen Gutekanst
66e56f037b
initial macOS backend (#1249)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Michael Bradshaw <github@mjb.io>
2024-08-18 16:45:37 -07:00
Stephen Gutekanst
6e2f937026 core: add Null backend to show what implementing a backend looks like
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-07-13 15:48:07 -07:00
Hordur Johannsson
c32e763e11
add new win32 platform implementation (#1224)
* Buffer resources from swap chain were not being released.
* sysgpu Texture.getWidth() should return width not height.
* d3d12: Fixing issues with d3d12 on sysgpu.
* Initial win32 platform
2024-07-13 15:33:45 -07:00
Ali Cheraghi
3fa889b136 core: revive wayland 2024-07-13 09:06:35 -07:00
Ali Cheraghi
266e7a548b core: refactor 2024-07-13 09:06:35 -07:00
Stephen Gutekanst
98801a258e remove Dawn / WebGPU support in favor of sysgpu
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-07-07 22:08:16 -07:00
Stephen Gutekanst
205a1f33db Core: support configuring window before it opens
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-14 00:12:26 +02:00
Stephen Gutekanst
122a1ea9a7 {gfx,examples}: simplify text rendering API a bit
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-14 00:12:26 +02:00
Stephen Gutekanst
ca27f1e263 Core: add window size in virtual pixels, update info each frame
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 14:26:34 +02:00
Stephen Gutekanst
22ac26b57e module: rename events -> systems, remove 'event arguments'
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-08 13:39:07 -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
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
d690814b16 Core: fix potential printTitle leak
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
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
68677b3448 {Core,examples}: set window title via component
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-29 20:17:26 -07:00
Stephen Gutekanst
7a1efdaa69 core: cleanup sysgpu feature flag logic
* `@import("mach").core.gpu` has been renamed to `@import("mach").gpu`
* `pub const SYSGPUInterface` now has a default value (i.e. you do not need to write it in your main.zig, if you were.)
* You can now check `if (comptime mach.use_sysgpu)` for any conditional code you might have that should only run with sysgpu.

This (old):

```
pub const mach_core_options = core.ComptimeOptions{
    .use_wgpu = false,
    .use_sysgpu = true,
};
```

Has been replaced by this:

```
pub const use_sysgpu = true;
```

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-19 20:48:33 -07:00
Stephen Gutekanst
4ba8addb3c core: synchronize global .init before first .tick
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-16 20:48:04 -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
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