summaryrefslogtreecommitdiff
path: root/src/framebuffer.rs
diff options
context:
space:
mode:
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;