Skip to content

Replace simple_sdl2 with simple_sdl3 #887

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
FEATURES_DEPENDING_ON_STD: "std,default"
# List of packages that can not target Wasm.
# `vello_tests` uses `nv-flip`, which doesn't support Wasm.
NO_WASM_PKGS: "--exclude vello_tests --exclude simple_sdl2"
NO_WASM_PKGS: "--exclude vello_tests --exclude simple_sdl3"
# The files stored in LFS the tests need to access, in JSON format
LFS_FILES: '["vello_tests/snapshots/*.png", "sparse_strips/vello_cpu/snapshots/*.png"]'

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ This release has an [MSRV][] of 1.85.

<!-- TODO: Wgpu 24 (#791); override_image change (#802) -->

### Changed

- The SDL2 example (`simple_sdl2`) has been replaced by `simple_sdl3` using SDL3. ([#887][] by [@waywardmonkeys][])


### Removed

- Breaking: The `Renderer::render_to_surface` has been removed. ([#803][] by [@DJMcNab][])
Expand Down Expand Up @@ -257,6 +262,7 @@ This release has an [MSRV][] of 1.75.
[#796]: https://github.com/linebender/vello/pull/796
[#803]: https://github.com/linebender/vello/pull/803
[#841]: https://github.com/linebender/vello/pull/841
[#887]: https://github.com/linebender/vello/pull/887

<!-- Note that this still comparing against 0.4.0, because 0.4.1 is a cherry-picked patch -->
[Unreleased]: https://github.com/linebender/vello/compare/v0.4.0...HEAD
Expand Down
127 changes: 90 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
"examples/run_wasm",
"examples/scenes",
"examples/simple",
"examples/simple_sdl2",
"examples/simple_sdl3",
"examples/with_winit",

"sparse_strips/vello_api",
Expand All @@ -28,7 +28,7 @@ members = [
# NOTE: When bumping this, remember to also bump the aforementioned other packages'
# version in the dependencies section at the bottom of this file.
# Additionally, bump the Vello dependency version in the 'simple'
# and `simple_sdl2` examples.
# and `simple_sdl3` examples.
version = "0.4.0"

edition = "2024"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "simple_sdl2"
name = "simple_sdl3"
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand All @@ -14,4 +14,4 @@ workspace = true
# remove the path property of the following Vello dependency requirement.
vello = { version = "0.4.0", path = "../../vello" }
pollster = "0.4.0"
sdl2 = { version = "0.37.0", features = ["raw-window-handle", "bundled"] }
sdl3 = { version = "0.14.20", features = ["raw-window-handle", "build-from-source-static"] }
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Vello can also be used with non-Winit crates which provide a `RawWindowHandle`.
//! This example uses it with [`sdl2`].
//! This example uses it with [`sdl3`].
//!
//! Vello however is primarily designed for Xilem, which uses Winit, and so support for non-Winit crates
//! is on a tier-2 basis, i.e. it is checked in CI, but is not rarely manually validated.
extern crate sdl2;

use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl3::event::Event;
use sdl3::keyboard::Keycode;

use std::num::NonZeroUsize;

Expand All @@ -22,14 +21,14 @@ use vello::{AaConfig, Renderer, RendererOptions, Scene};
use vello::wgpu;

fn main() {
let sdl_context = sdl2::init().unwrap();
let sdl_context = sdl3::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();

let width: u32 = 800;
let height: u32 = 600;

let window = video_subsystem
.window("Vello SDL2 Demo", width, height)
.window("Vello SDL3 Demo", width, height)
.position_centered()
.metal_view()
.build()
Expand Down
Loading