Web: Fullscreen Overhaul (#3063)

This commit is contained in:
daxpedda 2023-08-29 09:28:30 +02:00 committed by GitHub
parent 1dfca5a395
commit 0c8cf94a70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 225 additions and 148 deletions

View file

@ -65,7 +65,10 @@ mod wasm {
use softbuffer::{Surface, SurfaceExtWeb};
use wasm_bindgen::prelude::*;
use winit::{event::Event, window::Window};
use winit::{
event::{Event, WindowEvent},
window::Window,
};
#[wasm_bindgen(start)]
pub fn run() {
@ -116,6 +119,10 @@ mod wasm {
// So we implement this basic logging system into the page to give developers an easy alternative.
// As a bonus its also kind of handy on desktop.
let event = match event {
Event::WindowEvent {
event: WindowEvent::RedrawRequested,
..
} => None,
Event::WindowEvent { event, .. } => Some(format!("{event:?}")),
Event::Resumed | Event::Suspended => Some(format!("{event:?}")),
_ => None,