{mach,examples}: followups to getWindowSize / getFramebufferSize (#322)

* followup to window size saving, getWindowSize and getFramebufferSize no longer return errors
* updated the examples
This commit is contained in:
David Vanderson 2022-05-31 14:39:53 -04:00 committed by GitHub
parent 6bfb16554a
commit 3961073084
Failed to generate hash of commit
5 changed files with 10 additions and 10 deletions

View file

@ -38,7 +38,7 @@ pub fn init(app: *App, engine: *mach.Engine) !void {
const eye = vec3(5.0, 7.0, 5.0);
const target = vec3(0.0, 0.0, 0.0);
const size = try engine.core.getFramebufferSize();
const size = engine.core.getFramebufferSize();
const aspect_ratio = @intToFloat(f32, size.width) / @intToFloat(f32, size.height);
app.queue = engine.gpu_driver.device.getQueue();

View file

@ -99,7 +99,7 @@ pub fn init(app: *App, engine: *mach.Engine) !void {
app.texture_atlas_data.data,
);
const wsize = try engine.core.getWindowSize();
const wsize = engine.core.getWindowSize();
const window_width = @intToFloat(f32, wsize.width);
const window_height = @intToFloat(f32, wsize.height);
const triangle_scale = 250;
@ -324,7 +324,7 @@ pub fn getVertexUniformBufferObject(engine: *mach.Engine) !draw.VertexUniform {
// On e.g. macOS, window size may be 640x480 while framebuffer size may be
// 1280x960 (subpixels.) Doing this lets us use a pixel, not subpixel,
// coordinate system.
const window_size = try engine.core.getWindowSize();
const window_size = engine.core.getWindowSize();
const proj = zm.orthographicRh(
@intToFloat(f32, window_size.width),
@intToFloat(f32, window_size.height),