This correctly sets presentation modes for vsync, both at startup and at runtime via
a `setOptions` request.
Note: There may still be platforms where setting vsync is not enough, and a frame rate
limiter is needed to achieve proper synchronization. This is tracked in hexops/mach#444
and not fixed by this change.
Fixeshexops/mach#307
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This requires apps expose a `pub const App` from their `main.zig`, effectively adopting
the high-level/low-level application API outlined in hexops/mach#349
If `pub const App` does not exist, a clear compiler error is produced:
```
./src/platform/common.zig:5:9: error: expected e.g. `pub const App = mach.App(modules, init)' (App definition missing in your main Zig file)
@compileError("expected e.g. `pub const App = mach.App(modules, init)' (App definition missing in your main Zig file)");
^
./src/platform/native.zig:13:28: note: called from here
common.checkApplication(app_pkg);
^
./src/platform/native.zig:12:10: note: called from here
comptime {
^
./src/platform/native.zig:15:20: error: container '.app' has no member called 'App'
const App = app_pkg.App;
^
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Reused mach.Options for run time options. It is set with
Engine.setOptions function. ``pub const options`` on top level App has
no effect and will be ignored completely.
Added a blank struct StartupOptions which would be used for startup time
options in future. Currently they aren't used for anything.
GpuDriver
Core and GpuDriver both are merged into one type called Platform. Also
previously the fields and methods which were called as
``engine.core.field`` will now be ``engine.field`` i.e an extra layer is
removed.