From 4d5a1d9bc46db52e695c46a454dc44a8d38eeeb8 Mon Sep 17 00:00:00 2001 From: Cobrand Date: Thu, 13 Jun 2024 18:24:34 +0200 Subject: [PATCH] Prepare for 0.37.0 --- Cargo.toml | 4 ++-- README.md | 45 ++++++++++++++++++++++++--------------------- changelog.md | 15 ++++++++++++++- sdl2-sys/Cargo.toml | 4 ++-- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1e0d26b6b8..d431be61c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "sdl2" description = "SDL2 bindings for Rust" repository = "https://github.com/Rust-SDL2/rust-sdl2" documentation = "https://rust-sdl2.github.io/rust-sdl2/sdl2/" -version = "0.36.0" +version = "0.37.0" license = "MIT" authors = [ "Tony Aldridge ", "Cobrand "] keywords = ["SDL", "windowing", "graphics", "api", "engine"] @@ -22,7 +22,7 @@ lazy_static = "1.4.0" [dependencies.sdl2-sys] path = "sdl2-sys" -version = "^0.36.0" +version = "^0.37.0" [dependencies.c_vec] # allow both 1.* and 2.0 versions diff --git a/README.md b/README.md index 279e4c0d04..26fec10068 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Bindings for SDL2 in Rust -### [Changelog for 0.36.0](changelog.md#v0360) +### [Changelog for 0.37.0](changelog.md#v0370) # Overview @@ -10,24 +10,25 @@ Rust-SDL2 is a library for talking to the new SDL2.0 libraries from Rust. Low-level C components are wrapped in Rust code to make them more idiomatic and abstract away inappropriate manual memory management. -Rust-SDL2 uses the MIT license. +Rust-SDL2 uses the MIT license, but SDL2 itselfais in under the zlib license. -If you want a library compatible with earlier versions of SDL, please see -[here][early-sdl] +## Available rust features -# Documentation - -* [latest crate update documentation](https://docs.rs/sdl2/). -* [master documentation](https://rust-sdl2.github.io/rust-sdl2/sdl2/). +* `gfx` to link against SDL2\_gfx and have access to gfx features +* `image` to link against SDL2\_image and have access to image reading and writing features +* `mixer` to link against SDL2\_mixer and have access to sound mixing features +* `ttf` to link against SDL2\_ttf and have access to various font features +* `unsafe-textures` to not have a lifetime in `Texture` structs. Texture are only freed when the program exits, or can be done manually through `unsafe`. +* `use-bindgen` to customize bindings instead of using pre-generated `sdl_bindings` which were created from a Linux environment. It generates your own custom SDL2 bindings, tailored to your distro. Useful for specific window-related scenarios. +* `use-vcpkg` to pull SDL2 from vcpkg instead of looking in your system. +* `use-pkgconfig` use pkg-config to detect where your library is located on your system. Mostly useful on unix systems for static linking. +* `static-link` to link to SDL2 statically instead of dynamically. +* `use_mac_framework` to use SDL2 from a Framework, on macOS only +* `bundled`, which pulls the SDL repository and compiles it from source. More information below. -The following features are enabled in the documentation: -* gfx -* image -* mixer -* ttf +# Documentation -The `unsafe_textures` feature is not documented online, you can use `cargo doc` to generate your own documentation -with this feature enabled. +[Read the documentation here](https://docs.rs/sdl2/). # Requirements @@ -37,7 +38,7 @@ We currently target the latest stable release of Rust. ## *SDL2.0 development libraries* -SDL2 >= 2.0.14 is recommended to use these bindings; below 2.0.14, you may experience link-time errors as some functions are used here but are not defined in SDL2. If you experience this issue because you are on a LTS machine (for instance, Ubuntu 12.04 or Ubuntu 14.04), we definitely recommend you to use the feature "bundled" which will compile the lastest stable version of SDL2 for your project. +SDL2 >= 2.0.26 is recommended to use these bindings; below 2.0.26, you may experience link-time errors as some functions are used here but are not defined in SDL2. If you experience this issue because you are on a LTS machine (for instance, Ubuntu), we definitely recommend you to use the feature "bundled" which will compile the lastest stable version of SDL2 for your project. ### "Bundled" Feature @@ -53,6 +54,8 @@ println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path"); println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); ``` +**This ONLY works with SDL2, NOT SDL2_image, SDL2_mixer, SDL2_ttf, SDL2_gfx` + ### Linux Install these through your favourite package management tool, or via http://www.libsdl.org/ @@ -334,14 +337,14 @@ add the following your `Cargo.toml`: ```toml [dependencies.sdl2] -version = "0.36" +version = "0.37" default-features = false features = ["ttf","image","gfx","mixer","static-link","use-vcpkg"] [package.metadata.vcpkg] dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"] git = "https://github.com/microsoft/vcpkg" -rev = "261c458af6e3eed5d099144aff95d2b5035f656b" +rev = "2024.05.24" # release 2024.05.24 # to check for a new one, check https://github.com/microsoft/vcpkg/releases [package.metadata.vcpkg.target] x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" } @@ -356,7 +359,7 @@ download through Crates.io: ```toml [dependencies] - sdl2 = "0.36" + sdl2 = "0.37" ``` Alternatively, pull it from GitHub to obtain the latest version from master @@ -377,7 +380,7 @@ adding this instead: ```toml [dependencies.sdl2] - version = "0.36" + version = "0.37" default-features = false features = ["ttf","image","gfx","mixer"] ``` @@ -654,7 +657,7 @@ fn main() { ```toml [dependencies.sdl2] -version = "0.32" +version = "0.37" features = ["raw-window-handle"] ``` diff --git a/changelog.md b/changelog.md index 258661b48d..2610725fd2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,15 +1,28 @@ In this file will be listed the changes, especially the breaking ones that one should be careful of when upgrading from a version of rust-sdl2 to another. -### Unreleased +### v0.37.0 + +[PR #1406](https://github.com/Rust-SDL2/rust-sdl2/pull/1406) Update bindings to SDL 2.0.26, add Event.is\_touch() for mouse events, upgrade wgpu to 0.20 in examples + +[PR #1398](https://github.com/Rust-SDL2/rust-sdl2/pull/1398) Fix bug in rect.shift logic + [PR #1404](https://github.com/Rust-SDL2/rust-sdl2/pull/1404) Make `SdlDrop` a zero sized type. +[PR #1394](https://github.com/Rust-SDL2/rust-sdl2/pull/1394) Do not pull the SDL repository if not using bundled in build.rs + +[PR #1394](https://github.com/Rust-SDL2/rust-sdl2/pull/1394) Fix static linking + [PR #1389](https://github.com/Rust-SDL2/rust-sdl2/pull/1389) Fix some undefined behavior. [PR #1378](https://github.com/Rust-SDL2/rust-sdl2/pull/1378) **BREAKING CHANGE** Change `Keycode` to be a struct rather than an enum. Fix `Keycode::from_scancode` for non-QWERTY keyboard layouts. [PR #1390](https://github.com/Rust-SDL2/rust-sdl2/pull/1390) Apply clippy fixes, fix deprecations and other code quality improvements. +[PR #1385](https://github.com/Rust-SDL2/rust-sdl2/pull/1385) Upgrade raw-window-handle to 0.6.0 + +[PR #1380](https://github.com/Rust-SDL2/rust-sdl2/pull/1380) Add controller vendor\_id() and product\_id() + [PR #1368](https://github.com/Rust-SDL2/rust-sdl2/pull/1368) Remove unnecessary unsafe in Window interface. Make Window `Clone`. [PR #1366](https://github.com/Rust-SDL2/rust-sdl2/pull/1366) Add Primary Selection bindings. diff --git a/sdl2-sys/Cargo.toml b/sdl2-sys/Cargo.toml index 4e776e9350..c86cead37e 100644 --- a/sdl2-sys/Cargo.toml +++ b/sdl2-sys/Cargo.toml @@ -3,8 +3,8 @@ name = "sdl2-sys" description = "Raw SDL2 bindings for Rust, used internally rust-sdl2" repository = "https://github.com/rust-sdl2/rust-sdl2" -version = "0.36.0" -authors = ["Tony Aldridge "] +version = "0.37.0" +authors = ["Tony Aldridge ", "Cobrand "] keywords = ["SDL", "windowing", "graphics", "ffi"] categories = ["rendering","external-ffi-bindings","game-engines","multimedia"] license = "MIT AND Zlib"