summaryrefslogtreecommitdiff
path: root/src/framebuffer.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-12-10 15:10:00 -0500
committerLLLL Colonq <llll@colonq>2024-12-10 15:10:00 -0500
commite63685632f5fa560f5ebc8190f670f41d9218879 (patch)
treef2d5720ccc3d011cea58581d393784f85ece111e /src/framebuffer.rs
parentd5a5b454a4670a72826882c6ce4c87d1f597767c (diff)
Native done
Diffstat (limited to 'src/framebuffer.rs')
-rw-r--r--src/framebuffer.rs6
1 files changed, 6 insertions, 0 deletions
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;