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.
Previously if user code called core.getWindowSize() (or
getFramebufferSize) during their update they could get sizes that did
not match engine.gpu_driver.target_desc because the window had changed
size.
Now core.getWindowSize() returns the last size we got from a glfw
callback instead of directly querying the window. So all sizes should
agree during a single frame.
This relies on glfw callbacks only happening when we call
glfw.pollEvents(). This isn't strictly true - a callback could happen
during any glfw call. Might have to revisit this later.