Commit graph

52 commits

Author SHA1 Message Date
Hordur Johannsson
d7d8029523
core: add more keys to Key enum (#1262) 2024-08-31 13:24:36 -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
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
19afd254b9 core: restructure code
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 15:46:57 -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
e3393abbc1 deduplicate win32 bindings
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-25 15:24:24 -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
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
51e996db72 remove unmaintained WASM support
Same reasoning as outlined in #1254

> nobody is interested in actively maintaining or contributing to that today.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-24 23:22:52 -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
Michael Bradshaw
8ea49d1c80 Remove Objective-C dual namespacing 2024-08-23 20:43:38 -07:00
Michael Bradshaw
08f5b84227 Remove runtime Objective-C initialization and dependency on usingnamespace 2024-08-23 20:43:38 -07:00
Stephen Gutekanst
c04a6080b5 core: fix Darwin filepath case
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-08-19 22:41:58 -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
Hordur Johannsson
42d2a57611
Changing resource category for textures in d3d12 issue #1225 (#1226) 2024-08-07 21:58:59 -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
Ali Cheraghi
c254337e4b {core, build}: remove glfw 2024-07-13 09:06:35 -07:00
Ali Cheraghi
539aadf664 sysgpu: remove everything related to dawn 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
e6cecc3ebe core: remove all examples
These examples were great at showing how to use the WebGPU and sysgpu APIs
but otherwise had poor code quality, depended on zmath instead of mach.math,
etc. and so are being removed.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-07-07 22:08:16 -07:00
Stephen Gutekanst
2a7e6049fd linux: update to latest vulkan-zig API; fix build
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-06-02 18:57:45 -07:00
Stephen Gutekanst
707e5cc756 update to Zig 2024.05
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-06-02 18:57:45 -07:00
Stephen Gutekanst
ffd03c3b0b remove examples that require model3d
See hexops/mach#969

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-06-02 09:01:09 -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
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
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
44f950a7f3 core: provide a default sysgpu interface implementation
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
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
07d9855f73 core: examples: update import path style
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-19 19:05:18 -07:00
Stephen Gutekanst
2bc17a33fb module: correct alignment of dispatched arguments; move stack space to caller
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-04-19 18:05:17 -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
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
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
TheHonestHare
f369b31137 added swap chain usage flags to core.init() options 2024-04-08 23:54:43 -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
3ba511ffaf correct wasm32-freestanding build
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-03-08 23:56:59 -07:00
Stephen Gutekanst
b7fb2057f7 fix x86_64-linux-gnu build
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-03-08 23:44:33 -07:00