From e63685632f5fa560f5ebc8190f670f41d9218879 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 10 Dec 2024 15:10:00 -0500 Subject: Native done --- src/framebuffer.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/framebuffer.rs') diff --git a/src/framebuffer.rs b/src/framebuffer.rs index c0ac72b..fb6ab02 100644 --- a/src/framebuffer.rs +++ b/src/framebuffer.rs @@ -11,7 +11,13 @@ pub struct Framebuffer { impl Framebuffer { pub fn screen(ctx: &context::Context) -> Self { + #[cfg(target_arch = "wasm32")] let (windoww, windowh): (f32, f32) = ctx.window.inner_size().into(); + #[cfg(not(target_arch = "wasm32"))] + let (windoww, windowh) = { + let (w, h) = ctx.window.size(); + (w as f32, h as f32) + }; let ratio = context::compute_upscale(windoww as _, windowh as _) as f32; let upscalew = context::RENDER_WIDTH * ratio; let upscaleh = context::RENDER_HEIGHT * ratio; -- cgit v1.2.3