Ali Chraghi
a52c6e5f5c
gpu: update interface to latest webgpu headers
2023-01-14 12:12:00 -07:00
Ali Chraghi
a97a33334c
{mach, gpu-dawn}: don't hardcode linux window manager to X11
2023-01-12 10:51:16 -07:00
Ali Chraghi
1d7cd4be80
mach: fundamental changes
...
- Core doesn't depend to `App` anymore
- `setOptions` has replaced with some new functions (`setTitle`,
`setSize`, etc)
- and more
2023-01-12 01:54:48 -07:00
Lue
91a53807ab
mach: fix outdated reference to glfw.Error
2023-01-10 20:52:41 -07:00
Lue
eed2be4591
glfw: refactor getError and related functions
...
`getError()` now returns a struct `Error` containing `error_code` and
`description`. Rationale: retrieving the error code with the previous
implementation of `getError()` caused `getErrorString()` to return
null (the reverse is also true). The new implementation allows both
values to be retrieved at once.
The previous `getError()` function has been renamed to
`getErrorCode()` to reflect the fact that it returns a simple Zig
error rather than the `Error` struct. The error set returned by
`getErrorCode()` is now named `ErrorCode` rather than `Error`.
The behavior of the `getError()` family of functions clearing the
stored error is unchanged. However, since all code that used
`defer glfw.getError() catch {}` to explicitly clear errors had to be
refactored, a new `glfw.clearError()` function that returns void is
now available to make this operation more explicit.
Additionally, `mustGetError()` is now `mustGetErrorCode()`, and new
functions `mustGetError()` and `mustGetErrorString()` have been added
which wrap `getError()` and `getErrorString()` but panic if no error
is actually available.
Tests and API documentation had to be refactored across all of
`mach/glfw`. This commit also takes the opportunity to skip tests
involving window creation on CI so that other tests may still execute
normally.
2023-01-10 20:52:41 -07:00
Stephen Gutekanst
2cd4ce12f2
mach: update to latest GLFW error handling approach
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
Ali Chraghi
b8deaf8010
mach: add borderless_window option
2022-12-28 11:47:51 -07:00
Ali Chraghi
c26592ea89
mach: render during resize
2022-12-28 11:47:51 -07:00
Beau McCartney
7d04252126
mach: remove compiler error for missing field in app (upstream issue fixed) ( #647 )
...
* platform: allow fieldless App
* platform: remove unused field
Co-authored-by: Beau McCartney <beau@beaumccartney.xyz>
2022-12-25 13:37:23 -07:00
citruslee
0e67b92676
mach: fix compiler error about missing field_type ( #644 )
2022-12-22 11:50:26 -07:00
Ali Chraghi
457986bb33
mach: fix compilation on latest zig
2022-12-18 18:02:31 -07:00
BratishkaErik
b1191cbeb5
{mach,gpu}: more undef/nul -> undefined/null renames ( #638 )
...
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2022-12-14 18:20:11 -07:00
Eric Joldasov
e832784e6b
mach: use null and undefined in enums
...
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2022-12-14 02:18:21 -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
dasimmet
caafb26fe4
mach: add option to set the monitor index on fullscreen ( #611 )
...
* add option to set the monitor index on fullscreen
* make monitor index optional
Co-authored-by: Tobias Simetsreiter <tobias.simetsreiter@meliot.de>
2022-11-14 15:46:42 -07:00
Stephen Gutekanst
212c902747
mach: test ResourceManager
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-05 14:12:56 -07:00
Stephen Gutekanst
030cbf71a1
mach: resource: update function pointer declarations
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-05 13:32:18 -07:00
Stephen Gutekanst
6a45971c6f
trimesh2d: remove in favor of mach/earcut library
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Stephen Gutekanst
96c2e35ab3
all: integrate earcut library
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Ali Chraghi
a27121c00a
mach: implement setCursorMode for wasm
2022-10-21 07:43:34 -07:00
Stephen Gutekanst
af357c0a8a
mach: expose trimesh2d package
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-19 07:30:11 -07:00
Stephen Gutekanst
e0e0a6d0bb
mach: update wasm root.panic signature for latest Zig version
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-14 17:58:34 -07:00
Martin Wickham
78dfa2df6b
mach: add setCursorMode (desktop only for now)
2022-10-14 09:23:49 -07:00
Stephen Gutekanst
c94dee263b
mach: correct WebGPU C ABI export
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-11 01:06:59 +02:00
Ali Chraghi
58f7121a3d
all: prefix environment variables with MACH_
2022-10-11 00:59:23 +02:00
Stephen Gutekanst
4e47477e9a
mach: export WebGPU C ABI compatibility
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-11 00:55:46 +02:00
Dustin Taylor
cc301493ca
mach: 0 size swapchain noop fix
2022-09-25 10:01:03 -07:00
Stephen Gutekanst
8026526b99
mach: add TODO about self-hosted unused variables
2022-09-20 02:30:45 -07:00
Ali Chraghi
9f6c4bf7b1
build: fix compilation errors
...
this should make linux CI green
2022-09-20 02:30:45 -07:00
Ali Chraghi
2811904eac
mach: check Platform functions declaration & add deinit for wasm
2022-09-19 20:11:55 -07:00
Stephen Gutekanst
12c8d9ae8a
mach: correct Wayland comment
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-19 06:57:16 -07:00
Ali Chraghi
15dfb2867a
all: rename setShouldClose to close
...
Closes #550
2022-09-18 09:50:15 -07:00
Stephen Gutekanst
412df4490c
mach: fmt
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-17 08:50:25 -07:00
Ali Chraghi
6043c7eae6
mach: add is_app option to disable gamemode in desktop applications; use parseIp4 ( #544 )
...
* mach: add `is_app` option to disable gamemode in desktop applications
* use parseIp4 instead of resolveIp (which throws a compile error in windows)
2022-09-16 23:32:27 -07:00
LeRoyce Pearson
47d1544b64
{mach,sysjs}: put WASM imports into their own namespaces ( #537 )
2022-09-16 16:56:22 -07:00
Louis Pearson
6183e39593
mach: add {s} formatter to mouse cursor debug print ( #539 )
...
* Fix setMouseCursor compile error
2022-09-16 16:42:19 -07:00
Jeremia
7ed8829349
mach: better compile error for missing fields in App. ( #548 )
...
Stage2 Zig ends up coercing structs without any fields into consts.
The current error given is not entirely clear to the cause or how
to fix the issue for users.
Related to https://github.com/ziglang/zig/issues/12275
2022-09-16 16:36:15 -07:00
praschke
b0cd4ec1a0
all: fix pointless discards; typo; fix libmach compilation on Linux ( #541 )
2022-09-15 07:41:05 -07:00
praschke
38c4fc5b01
mach: make default minimum window size 350x350
2022-09-15 07:39:38 -07:00
praschke
a873227ab8
{mach,examples,shaderexp}: fix default minimum window size
2022-09-15 07:39:38 -07:00
Louis Pearson
9676665ccf
mach: fix setMouseCursor compile error ( #538 )
2022-09-14 18:15:41 -07:00
locriacyber
b8c48d6321
all: remove ineffective _ = variable assignments ( #530 )
...
Lastest Zig complains about this, so they must removed to build.
2022-09-14 09:42:29 -07:00
Stephen Gutekanst
8113ca370d
all: remove support for stage1
...
With almost all tests/examples working on all platforms now with the new compiler,
https://github.com/hexops/mach/issues/180 , it's time to remove stage1 support.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 00:09:30 -07:00
Louis Pearson
70f4514c66
sysaudio: fix compile for web
2022-09-09 22:39:35 -07:00
Stephen Gutekanst
78485e49f5
mach: wasm: add stub GPUInterface
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 22:06:27 -07:00
Stephen Gutekanst
9a759c55c5
mach: do not attempt to import gamemode on non-Linux platforms
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-08 07:26:46 -07:00
Stephen Gutekanst
c97bcdde0a
mach: improve compatibility with self-hosted compiler
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-08 07:26:30 -07:00
Ali Chraghi
194971586d
mach: use std.log.(scope) instead of std.debug.print
2022-09-07 21:25:35 -07:00
Ali Chraghi
d8af6740c5
mach: exit if no backend found for adapter
2022-09-07 21:25:35 -07:00