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 winit 0.25 #103

Merged
merged 2 commits into from Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -71,6 +71,14 @@ jobs:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

# Run tests (within winit 0.25)
- name: Run tests
run: cargo test --workspace --features=winit-25,winit-app
if: ${{ runner.os == 'Linux' }}
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

clean:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 5 additions & 4 deletions Cargo.toml
Expand Up @@ -46,6 +46,7 @@ winit-21 = ["skulpin-app-winit/winit-21"]
winit-22 = ["skulpin-app-winit/winit-22"]
winit-23 = ["skulpin-app-winit/winit-23"]
winit-24 = ["skulpin-app-winit/winit-24"]
winit-25 = ["skulpin-app-winit/winit-25"]
winit-latest = ["skulpin-app-winit/winit-latest"]

default = []
Expand Down Expand Up @@ -73,21 +74,21 @@ required-features = []

[[example]]
name = "hello_skulpin_winit"
required-features = ["winit-app", "winit-24"]
required-features = ["winit-app", "winit-25"]

[[example]]
name = "hello_skulpin_winit_app"
required-features = ["winit-app", "winit-24"]
required-features = ["winit-app", "winit-25"]

[[example]]
name = "interactive_sdl2"
required-features = []

[[example]]
name = "interactive_winit_app"
required-features = ["winit-app", "winit-24"]
required-features = ["winit-app", "winit-25"]

[[example]]
name = "physics"
required-features = ["winit-app", "winit-24"]
required-features = ["winit-app", "winit-25"]

5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -27,7 +27,7 @@ The [interactive](examples/interactive_winit_app.rs) example is good to look at

```
# winit 0.24
cargo run --example interactive_winit_app --features winit-app,winit-24
cargo run --example interactive_winit_app --features winit-app,winit-25

# sdl2
cargo run --example interactive_sdl2
Expand All @@ -36,7 +36,7 @@ cargo run --example interactive_sdl2
The [physics](examples/physics.rs) demo is fun too.

```
cargo run --example physics --features winit-app,winit-24
cargo run --example physics --features winit-app,winit-25
```

Here's a video of the physics and interactive examples.
Expand Down Expand Up @@ -90,6 +90,7 @@ If using winit-app, you MUST specify a winit version feature flag (see below)
* `winit-22`
* `winit-23`
* `winit-24`
* `winit-25`
* `winit-latest`

(These feature names match the imgui-rs crate.)
Expand Down
1 change: 1 addition & 0 deletions skulpin-app-winit/Cargo.toml
Expand Up @@ -21,6 +21,7 @@ winit-21 = { package = "winit", version = "0.21", optional = true }
winit-22 = { package = "winit", version = "0.22", optional = true }
winit-23 = { package = "winit", version = "0.23", optional = true }
winit-24 = { package = "winit", version = "0.24", optional = true }
winit-25 = { package = "winit", version = "0.25", optional = true }
winit-latest = { package = "winit", version = ">=0.23", optional = true }
raw-window-handle = "0.3"

Expand Down
7 changes: 6 additions & 1 deletion skulpin-app-winit/src/input_state.rs
Expand Up @@ -532,7 +532,12 @@ impl InputState {
);
}

#[cfg(any(feature = "winit-23", feature = "winit-24", feature = "winit-latest"))]
#[cfg(any(
feature = "winit-23",
feature = "winit-24",
feature = "winit-25",
feature = "winit-latest"
))]
{
self.mouse_wheel_delta = MouseScrollDelta::PixelDelta(
PhysicalPosition::<f64>::new(d1.x + d2.x, d1.y + d2.y),
Expand Down
2 changes: 2 additions & 0 deletions skulpin-app-winit/src/lib.rs
Expand Up @@ -47,5 +47,7 @@ pub use winit_22 as winit;
pub use winit_23 as winit;
#[cfg(feature = "winit-24")]
pub use winit_24 as winit;
#[cfg(feature = "winit-25")]
pub use winit_25 as winit;
#[cfg(feature = "winit-latest")]
pub use winit_latest as winit;