Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web support via stdweb and web-sys #1221

Merged
merged 79 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
fd4db40
Create the type layout
ryanisaacg Feb 13, 2019
f44e98d
Implemented a few easy methods
ryanisaacg Feb 20, 2019
c088f8b
Create the outline of event input and handler calls
ryanisaacg Feb 26, 2019
f698d45
Add key and mouse event support that typechecks
ryanisaacg Mar 2, 2019
37d354c
Get to a state where a canvas is spawned
ryanisaacg Mar 10, 2019
283a8de
Refactor out the stdweb functionality into different modules
ryanisaacg Mar 10, 2019
3dd0e31
Merge eventloop-2.0 into stdweb-eventloop-2
ryanisaacg Mar 11, 2019
aaee724
Rearchitect to allow API compliance
ryanisaacg Mar 12, 2019
d1deba8
Rename modules
ryanisaacg Mar 12, 2019
a5166ba
Implement request_redraw
ryanisaacg Mar 16, 2019
96786bb
Implement focus event
ryanisaacg Mar 16, 2019
85446d8
Fix warnings
ryanisaacg Mar 16, 2019
b09629f
Handle ControlFlow::Exit
ryanisaacg Mar 19, 2019
7c6bdcc
Handle ControlFlow::Exit and dealing with events-in-events
ryanisaacg Mar 23, 2019
9e25561
Fix compile failures and add canvas positioning
ryanisaacg Apr 3, 2019
fe5e300
Clean up and document the core of stdweb event handling
ryanisaacg Apr 25, 2019
9f801cf
Only send the request-redraw on the next animation frame
ryanisaacg Apr 29, 2019
70c7382
Fix the request_animation_frame lifetimes
ryanisaacg May 2, 2019
37dadab
Add access to the canvas in the Window
ryanisaacg Jun 1, 2019
1409f83
Add support for mouse wheel
ryanisaacg Jun 1, 2019
f2b6ef2
Merge master into stdweb-eventloop-2
ryanisaacg Jun 1, 2019
b59e3c6
WIP
ryanisaacg Jun 15, 2019
2690306
Implement Poll and WaitUntil in the stdweb backend
ryanisaacg Jun 17, 2019
182beb4
Indicate that I will be maintaing the stdweb backend
ryanisaacg Jun 17, 2019
e4d8e22
Start implementing web-sys backend
blm768 Jun 4, 2019
54b4074
Port remaining modules to web_sys
blm768 Jun 5, 2019
7dabad4
Fix throwToEscapeEventLoop function
blm768 Jun 6, 2019
77cd3ad
TEMPORARY: add testing example
blm768 Jun 6, 2019
94f6294
Prevent callbacks from being destroyed too early
blm768 Jun 7, 2019
91a511b
Replace JS snippet with throw_str
blm768 Jun 8, 2019
7de1261
Fix some warnings
blm768 Jun 8, 2019
5d31f73
Clean up Cargo.toml after incorrect rebase
blm768 Jun 18, 2019
b571362
Fix a panic due to double-borrow
ryanisaacg Jun 21, 2019
cf28751
Remove unnecessary set-to-wait in example
ryanisaacg Jun 23, 2019
a0f280e
Update how timeouts are cleared to avoid possible double-clearing
ryanisaacg Jun 23, 2019
eea9530
Merge remote-tracking branch 'blm/web-sys' into stdweb-eventloop-2
hecrj Jun 24, 2019
c5703eb
Draft `web` platform structure
hecrj Jun 25, 2019
b79089e
Implement `web_sys::Canvas` event listeners
hecrj Jun 25, 2019
9c5657b
Remove `Canvas` when dropped
hecrj Jun 25, 2019
d5368d7
Implement `Canvas::request_redraw`
hecrj Jun 25, 2019
8ad078b
Implement keyboard and blur/focus events
hecrj Jun 25, 2019
8f66d96
Support `ReceivedCharacter` event
hecrj Jun 25, 2019
1596cc5
Avoid leaking implementation details in `Canvas` API
hecrj Jun 25, 2019
bb28598
Implement `stdweb` backend for `web` platform
hecrj Jun 26, 2019
2a35646
Use latest `stdweb` revision
hecrj Jun 26, 2019
ea73dac
Fix feature names
hecrj Jun 26, 2019
7f2ba0e
Fix `set_cursor_icon`
hecrj Jun 29, 2019
de12028
Fix mouse release/press events
hecrj Jun 29, 2019
e89674d
Add `dyn` keyword where necessary
hecrj Jul 1, 2019
5cc84f3
Improve feature names to enable web backends
hecrj Jul 1, 2019
76645f3
Bump version
hecrj Jul 7, 2019
613fafd
Merge branch 'web' into webmerge2
goddessfreya Jul 10, 2019
53e646d
Merge pull request #1038 from ZeGentzy/web
Osspial Jul 10, 2019
7b23d19
Fix `web` errors (#1040)
hecrj Jul 10, 2019
fe12996
Update the web backend todo list
ryanisaacg Jul 17, 2019
e897d70
Bump the stdweb version to 0.4.18 (#1049)
ryanisaacg Jul 17, 2019
dbdde3d
Stop appending canvas to document in web platform (#1089)
hecrj Aug 8, 2019
7ee9d56
Disable web module on other targets than wasm32 (#1102)
Aug 14, 2019
e87bc3d
Send a LoopDestroyed event when the browser is closed (#1155)
ryanisaacg Sep 11, 2019
2c47c43
Implement WindowID on the web platform (#1177)
ryanisaacg Sep 19, 2019
28a5081
Fix web redraw requested (#1181)
ryanisaacg Sep 23, 2019
3e8669e
Merge branch 'master' into merge-master-to-web
ryanisaacg Sep 24, 2019
8cea3e2
Update the documentation to reflect web support (#1183)
ryanisaacg Sep 24, 2019
6732fa7
Fix compilation errors
ryanisaacg Sep 24, 2019
86bafdc
Merge branch 'web' into merge-master-to-web
ryanisaacg Sep 24, 2019
dcd9ddd
Fix the examples
ryanisaacg Sep 24, 2019
ea93a01
Switch to the released version
ryanisaacg Sep 27, 2019
a336e9e
Fix the formatting in the changelog
ryanisaacg Sep 27, 2019
cf3b0f3
Attach the raw handle data attribute
ryanisaacg Sep 27, 2019
e21df58
Merge branch 'master' into merge-master-to-web
ryanisaacg Sep 30, 2019
ab4d971
Fix imports in the multithreaded example
ryanisaacg Sep 30, 2019
02f2815
Update cargo fmt
ryanisaacg Sep 30, 2019
157ca9c
Update the feature matrix for wasm (#1218)
ryanisaacg Oct 9, 2019
bedb889
Fix the event key code variable name (#1219)
ryanisaacg Oct 11, 2019
3ff4834
Add web fullscreen support (#1142)
ryanisaacg Oct 11, 2019
a557b3c
Add web targets to travis (#1220)
ryanisaacg Oct 13, 2019
f62bb33
Merge branch 'master' into web
ryanisaacg Oct 13, 2019
676268d
Merge remote-tracking branch 'upstream/master' into web
ryanisaacg Oct 13, 2019
35bc65f
Remove usage of derivative
ryanisaacg Oct 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ Cargo.lock
target/
rls/
.vscode/
util/
*~
*.wasm
*.ts
*.js
#*#
31 changes: 27 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ matrix:
os: osx
rust: stable

# wasm stdweb
- env: TARGET=wasm32-unknown-unknown WEB=web FEATURES=stdweb
os: linux
rust: stable
- env: TARGET=wasm32-unknown-unknown WEB=web FEATURES=stdweb
os: linux
rust: nightly
# wasm web-sys
- env: TARGET=wasm32-unknown-unknown FEATURES=web-sys
os: linux
rust: stable
- env: TARGET=wasm32-unknown-unknown FEATURES=web-sys
os: linux
rust: nightly

install:
- rustup self update
- rustup target add $TARGET; true
Expand All @@ -66,11 +81,19 @@ install:

script:
- cargo +stable fmt --all -- --check
- cargo build --target $TARGET --verbose
- cargo build --target $TARGET --features serde --verbose
# Install cargo-web to build stdweb
- if [[ $WEB = "web" ]]; then cargo install -f cargo-web; fi
# Build without serde then with serde
- if [[ -z "$FEATURES" ]]; then
cargo $WEB build --target $TARGET --verbose;
else
cargo $WEB build --target $TARGET --features $FEATURES --verbose;
fi
- cargo $WEB build --target $TARGET --features serde,$FEATURES --verbose
# Running iOS apps on macOS requires the Simulator so we skip that for now
- if [[ $TARGET != *-apple-ios ]]; then cargo test --target $TARGET --verbose; fi
- if [[ $TARGET != *-apple-ios ]]; then cargo test --target $TARGET --features serde --verbose; fi
# The web targets also don't support running tests
- if [[ $TARGET != *-apple-ios && $TARGET != wasm32-* ]]; then cargo test --target $TARGET --verbose; fi
- if [[ $TARGET != *-apple-ios && $TARGET != wasm32-* ]]; then cargo test --target $TARGET --features serde --verbose; fi

after_success:
- |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Add web support via the 'stdweb' or 'web-sys' features
- On Windows, implemented function to get HINSTANCE
- On macOS, implement `run_return`.
- On iOS, fix inverted parameter in `set_prefers_home_indicator_hidden`.
Expand Down
38 changes: 38 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ categories = ["gui"]
[package.metadata.docs.rs]
features = ["serde"]

[features]
web-sys = ["web_sys", "wasm-bindgen", "instant/wasm-bindgen"]
stdweb = ["std_web", "instant/stdweb"]

[dependencies]
instant = "0.1"
lazy_static = "1"
libc = "0.2"
log = "0.4"
Expand Down Expand Up @@ -79,3 +84,36 @@ percent-encoding = "2.0"

[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "windows"))'.dependencies.parking_lot]
version = "0.9"

[target.'cfg(target_arch = "wasm32")'.dependencies.web_sys]
package = "web-sys"
version = "0.3.22"
optional = true
features = [
'console',
'BeforeUnloadEvent',
'Document',
'DomRect',
'Element',
'Event',
'EventTarget',
'FocusEvent',
'HtmlCanvasElement',
'HtmlElement',
'KeyboardEvent',
'MouseEvent',
'Node',
'PointerEvent',
'Window',
'WheelEvent'
]

[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen]
version = "0.2.45"
optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies.std_web]
package = "stdweb"
version = "=0.4.20"
optional = true
features = ["experimental_features_which_may_break_on_minor_version_bumps"]
48 changes: 24 additions & 24 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,39 +163,39 @@ Legend:
### Windowing
|Feature |Windows|MacOS |Linux x11 |Linux Wayland |Android|iOS |WASM |
|-------------------------------- | ----- | ---- | ------- | ----------- | ----- | ----- | -------- |
|Window initialization |✔️ |✔️ |▢[#5] |✔️ |▢[#33]|▢[#33] | |
|Providing pointer to init OpenGL |✔️ |✔️ |✔️ |✔️ |✔️ |✔️ ||
|Providing pointer to init Vulkan |✔️ |✔️ |✔️ |✔️ |✔️ |❓ ||
|Window decorations |✔️ |✔️ |✔️ |▢[#306] |**N/A**|**N/A**||
|Window decorations toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**||
|Window resizing |✔️ |▢[#219]|✔️ |▢[#306] |**N/A**|**N/A**| |
|Window resize increments |❌ |❌ |❌ |❌ |❌ |❌ ||
|Window transparency |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**| |
|Window maximization |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**||
|Window maximization toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**||
|Fullscreen |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ | |
|Fullscreen toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ | |
|Exclusive fullscreen |✔️ |✔️ |✔️ |**N/A** |❌ |✔️ ||
|HiDPI support |✔️ |✔️ |✔️ |✔️ |▢[#721]|✔️ ||
|Popup windows |❌ |❌ |❌ |❌ |❌ |❌ ||
|Window initialization |✔️ |✔️ |▢[#5] |✔️ |▢[#33]|▢[#33] |✔️ |
|Providing pointer to init OpenGL |✔️ |✔️ |✔️ |✔️ |✔️ |✔️ |**N/A**|
|Providing pointer to init Vulkan |✔️ |✔️ |✔️ |✔️ |✔️ |❓ |**N/A**|
|Window decorations |✔️ |✔️ |✔️ |▢[#306] |**N/A**|**N/A**|**N/A**|
|Window decorations toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|**N/A**|
|Window resizing |✔️ |▢[#219]|✔️ |▢[#306] |**N/A**|**N/A**|✔️ |
|Window resize increments |❌ |❌ |❌ |❌ |❌ |❌ |**N/A**|
|Window transparency |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|N/A |
|Window maximization |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|**N/A**|
|Window maximization toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|**N/A**|
|Fullscreen |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ |✔️ |
|Fullscreen toggle |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ |✔️ |
|Exclusive fullscreen |✔️ |✔️ |✔️ |**N/A** |❌ |✔️ |**N/A**|
|HiDPI support |✔️ |✔️ |✔️ |✔️ |▢[#721]|✔️ |**N/A**|
|Popup windows |❌ |❌ |❌ |❌ |❌ |❌ |**N/A**|

### System information
|Feature |Windows|MacOS |Linux x11|Linux Wayland|Android|iOS |WASM |
|---------------- | ----- | ---- | ------- | ----------- | ----- | ------- | -------- |
|Monitor list |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ ||
|Video mode query |✔️ |✔️ |✔️ |✔️ |❌ |✔️ ||
|Monitor list |✔️ |✔️ |✔️ |✔️ |**N/A**|✔️ |**N/A**|
|Video mode query |✔️ |✔️ |✔️ |✔️ |❌ |✔️ |**N/A**|

### Input handling
|Feature |Windows |MacOS |Linux x11|Linux Wayland|Android|iOS |WASM |
|----------------------- | ----- | ---- | ------- | ----------- | ----- | ----- | -------- |
|Mouse events |✔️ |▢[#63] |✔️ |✔️ |**N/A**|**N/A**| |
|Mouse set location |✔️ |✔️ |✔️ |❓ |**N/A**|**N/A**||
|Mouse events |✔️ |▢[#63] |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|Mouse set location |✔️ |✔️ |✔️ |❓ |**N/A**|**N/A**|**N/A**|
|Cursor grab |✔️ |▢[#165] |▢[#242] |✔️ |**N/A**|**N/A**|❓ |
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**| |
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ | |
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ | |
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ | |
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ | |
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**|✔️ |
|Touch events |✔️ |❌ |✔️ |✔️ |✔️ |✔️ |✔️ |
|Touch pressure |✔️ |❌ |❌ |❌ |❌ |✔️ |✔️ |
|Multitouch |✔️ |❌ |✔️ |✔️ |❓ |✔️ |✔️ |
|Keyboard events |✔️ |✔️ |✔️ |✔️ |❓ |❌ |✔️ |
|Drag & Drop |▢[#720] |▢[#720] |▢[#720] |❌[#306] |**N/A**|**N/A**|❓ |
|Raw Device Events |▢[#750] |▢[#750] |▢[#750] |❌ |❌ |❌ |❓ |
|Gamepad/Joystick events |❌[#804] |❌ |❌ |❌ |❌ |❌ |❓ |
Expand Down
26 changes: 16 additions & 10 deletions examples/custom_events.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
#[cfg(not(target_arch = "wasm32"))]
fn main() {
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};

#[derive(Debug, Clone, Copy)]
enum CustomEvent {
Timer,
}
#[derive(Debug, Clone, Copy)]
enum CustomEvent {
Timer,
}

fn main() {
let event_loop = EventLoop::<CustomEvent>::with_user_event();

let _window = WindowBuilder::new()
Expand Down Expand Up @@ -39,3 +40,8 @@ fn main() {
_ => *control_flow = ControlFlow::Wait,
});
}

#[cfg(target_arch = "wasm32")]
fn main() {
panic!("This example is not supported on web.");
}
29 changes: 18 additions & 11 deletions examples/multithreaded.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
extern crate env_logger;
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};
#[cfg(not(target_arch = "wasm32"))]
fn main() {
extern crate env_logger;

use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{CursorIcon, Fullscreen, WindowBuilder},
};
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};

const WINDOW_COUNT: usize = 3;
const WINDOW_SIZE: (u32, u32) = (600, 400);
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{CursorIcon, Fullscreen, WindowBuilder},
};

const WINDOW_COUNT: usize = 3;
const WINDOW_SIZE: (u32, u32) = (600, 400);

fn main() {
env_logger::init();
let event_loop = EventLoop::new();
let mut window_senders = HashMap::with_capacity(WINDOW_COUNT);
Expand Down Expand Up @@ -59,7 +61,7 @@ fn main() {
} => {
window.set_title(&format!("{:?}", key));
let state = !modifiers.shift;
use self::VirtualKeyCode::*;
use VirtualKeyCode::*;
match key {
A => window.set_always_on_top(state),
C => window.set_cursor_icon(match state {
Expand Down Expand Up @@ -167,3 +169,8 @@ fn main() {
}
})
}

#[cfg(target_arch = "wasm32")]
fn main() {
panic!("Example not supported on Wasm");
}
3 changes: 2 additions & 1 deletion examples/request_redraw.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::time::{Duration, Instant};
use instant::Instant;
use std::time::Duration;

use winit::{
event::{Event, WindowEvent},
Expand Down
3 changes: 2 additions & 1 deletion examples/timer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::time::{Duration, Instant};
use instant::Instant;
use std::time::Duration;
use winit::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
Expand Down
3 changes: 1 addition & 2 deletions examples/window_run_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn main() {
platform::desktop::EventLoopExtDesktop,
window::WindowBuilder,
};

let mut event_loop = EventLoop::new();

let window = WindowBuilder::new()
Expand Down Expand Up @@ -50,7 +49,7 @@ fn main() {
println!("Okay we're done now for real.");
}

#[cfg(any(target_os = "ios", target_os = "android"))]
#[cfg(any(target_os = "ios", target_os = "android", target_arch = "wasm32"))]
fn main() {
println!("This platform doesn't support run_return.");
}
1 change: 1 addition & 0 deletions src/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
//! - **Wayland:** On Wayland, DPI factors are set per-screen by the server, and are always integers (most often 1 or 2).
//! - **iOS:** DPI factors are both constant and device-specific on iOS.
//! - **Android:** This feature isn't yet implemented on Android, so the DPI factor will always be returned as 1.0.
//! - **Web:** DPI factors are handled by the browser and will always be 1.0 for your application.
//!
//! The window's logical size is conserved across DPI changes, resulting in the physical size changing instead. This
//! may be surprising on X11, but is quite standard elsewhere. Physical size changes always produce a
Expand Down
5 changes: 3 additions & 2 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
//! processed and used to modify the program state. For more details, see the root-level documentation.
//!
//! [event_loop_run]: ../event_loop/struct.EventLoop.html#method.run
use std::{path::PathBuf, time::Instant};
use instant::Instant;
use std::path::PathBuf;

use crate::{
dpi::{LogicalPosition, LogicalSize},
Expand Down Expand Up @@ -61,7 +62,7 @@ impl<T> Event<T> {
}

/// Describes the reason the event loop is resuming.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum StartCause {
/// Sent if the time specified by `ControlFlow::WaitUntil` has been reached. Contains the
/// moment the timeout was requested and the requested resume time. The actual resume time is
Expand Down
6 changes: 4 additions & 2 deletions src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//! [create_proxy]: ./struct.EventLoop.html#method.create_proxy
//! [event_loop_proxy]: ./struct.EventLoopProxy.html
//! [send_event]: ./struct.EventLoopProxy.html#method.send_event
use std::{error, fmt, ops::Deref, time::Instant};
use instant::Instant;
use std::ops::Deref;
use std::{error, fmt};

use crate::{event::Event, monitor::MonitorHandle, platform_impl};

Expand Down Expand Up @@ -66,7 +68,7 @@ impl<T> fmt::Debug for EventLoopWindowTarget<T> {
/// the control flow to `Poll`.
///
/// [events_cleared]: ../event/enum.Event.html#variant.EventsCleared
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ControlFlow {
/// When the current loop iteration finishes, immediately begin a new iteration regardless of
/// whether or not new events are available to process.
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
//! match event {
//! Event::EventsCleared => {
//! // Application update code.
//!
//!
//! // Queue a RedrawRequested event.
//! window.request_redraw();
//! },
Expand Down Expand Up @@ -126,6 +126,8 @@ extern crate bitflags;
#[cfg(any(target_os = "macos", target_os = "ios"))]
#[macro_use]
extern crate objc;
#[cfg(feature = "std_web")]
extern crate std_web as stdweb;

pub mod dpi;
#[macro_use]
Expand Down
Loading