Skip to content

Commit

Permalink
Prepare for 0.37.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobrand committed Jun 13, 2024
1 parent 48509ea commit 4d5a1d9
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>", "Cobrand <[email protected]>"]
keywords = ["SDL", "windowing", "graphics", "api", "engine"]
Expand All @@ -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
Expand Down
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@

Bindings for SDL2 in Rust

### [Changelog for 0.36.0](changelog.md#v0360)
### [Changelog for 0.37.0](changelog.md#v0370)

# Overview

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

Expand All @@ -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

Expand All @@ -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/
Expand Down Expand Up @@ -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" }
Expand All @@ -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
Expand All @@ -377,7 +380,7 @@ adding this instead:

```toml
[dependencies.sdl2]
version = "0.36"
version = "0.37"
default-features = false
features = ["ttf","image","gfx","mixer"]
```
Expand Down Expand Up @@ -654,7 +657,7 @@ fn main() {

```toml
[dependencies.sdl2]
version = "0.32"
version = "0.37"
features = ["raw-window-handle"]
```

Expand Down
15 changes: 14 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions sdl2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
version = "0.37.0"
authors = ["Tony Aldridge <[email protected]>", "Cobrand <[email protected]>"]
keywords = ["SDL", "windowing", "graphics", "ffi"]
categories = ["rendering","external-ffi-bindings","game-engines","multimedia"]
license = "MIT AND Zlib"
Expand Down

0 comments on commit 4d5a1d9

Please sign in to comment.