sdl2
SDL2 bindings for Rust
0.38.0
5.0M downloads/mo
#4516 most downloaded on crates.io
Rust-SDL2/rust-sdl2
What this package is like to depend on
Last release 1 years ago
12 Jul 2025
Release timing varies
gaps range from 3 weeks to 1.8 years
Rarely documented
notes for 14 of 93 stable releases
1 version withdrawn
withdrawn after publishing
12 years old
98 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
98 releases · Nov 2014 to Jul 2025Releases
latest 60 of 98-
0.38.012 Jul 2025Release notes
Open source →PR #1493 Add
Rect::originand specifies origin location inRect::new.PR #1472 Add
Canvas::render_geometry,Canvas::render_geometry_rawand an example that uses them both. Both these bindings useSDL_RenderGeometryRaw.PR #1473 BREAKING CHANGE Fix UB in
ToColorimplementations and remove implementation forisize.PR #1414 Use
TTF_GlyphIsProvided32andTTF_GlyphMetrics32instead of the 16 bit ones.PR #1435 BREAKING CHANGE Fix some undefined behavior. Breaking changes:
mixer::Chunk's fields are now private and callbacks toTimerSubsystem::add_timermust now live for'static, also allowing some lifetime parameters to be removed.PR #1461 BREAKING CHANGE Added new SensorType variants: LeftGyroscope, RightGyroscope, LeftAccelerometer, RightAccelerometer
PR #1461 BREAKING CHANGE Sensor::get_data now returns correct SensorData::Gyro enum
PR #1437 BREAKING CHANGE Prevent users from creating
Sdl2TtfContextout of nothing and use SDL's reference counting init/quitPR #1464 Added binding for
Mix_OpenAudioDevicePR #1451 Add
gamma_ramp_arraysandcalculate_gamma_ramp.PR #1459 BREAKING CHANGE Fix image and mixer init flag logic.
image::initandmixer::initwill now return an error if any of the requested formats can not be initialized.PR #1444 Add texture scale mode api + fix unsafe
PR #1415 Store
gfx::framerate::FPSmanagerdirectly inFPSManagerinstead of on the heap.PR #1450 BREAKING CHANGE Create ClippingRect type, to disambiguate between no and zero area clipping rect.
PR #1416 Apply clippy fixes, fix deprecations and other code quality improvements.
PR #1408 Allow comparing
Versions, add constant with the version the bindings were compiled with.PR #1407 Add new use_ios_framework for linking to SDL2.framework on iOS
PR #1427 BREAKING CHANGE Add system locale support. A new event type
Event::LocaleChangedhas been added.Release notes
Open source →PR #1493 Add
Rect::originand specifies origin location inRect::new.PR #1472 Add
Canvas::render_geometry,Canvas::render_geometry_rawand an example that uses them both. Both these bindings useSDL_RenderGeometryRaw.PR #1473 BREAKING CHANGE Fix UB in
ToColorimplementations and remove implementation forisize.PR #1414 Use
TTF_GlyphIsProvided32andTTF_GlyphMetrics32instead of the 16 bit ones.PR #1435 BREAKING CHANGE Fix some undefined behavior. Breaking changes:
mixer::Chunk's fields are now private and callbacks toTimerSubsystem::add_timermust now live for'static, also allowing some lifetime parameters to be removed.PR #1461 BREAKING CHANGE Added new SensorType variants: LeftGyroscope, RightGyroscope, LeftAccelerometer, RightAccelerometer
PR #1461 BREAKING CHANGE Sensor::get_data now returns correct SensorData::Gyro enum
PR #1437 BREAKING CHANGE Prevent users from creating
Sdl2TtfContextout of nothing and use SDL's reference counting init/quitPR #1464 Added binding for
Mix_OpenAudioDevicePR #1451 Add
gamma_ramp_arraysandcalculate_gamma_ramp.PR #1459 Fix image and mixer init flag logic
PR #1444 Add texture scale mode api + fix unsafe
PR #1415 Store
gfx::framerate::FPSmanagerdirectly inFPSManagerinstead of on the heap.PR #1450 BREAKING CHANGE Create ClippingRect type, to disambiguate between no and zero area clipping rect.
PR #1416 Apply clippy fixes, fix deprecations and other code quality improvements.
PR #1408 Allow comparing
Versions, add constant with the version the bindings were compiled with.PR #1407 Add new use_ios_framework for linking to SDL2.framework on iOS
PR #1427 BREAKING CHANGE Add system locale support. A new event type
Event::LocaleChangedhas been added. -
0.37.013 Jun 2024Release notes
Open source →PR #1406 Update bindings to SDL 2.0.26, add Event.is_touch() for mouse events, upgrade wgpu to 0.20 in examples
PR #1398 Fix bug in rect.shift logic
PR #1404 Make
SdlDropa zero sized type.PR #1394 Do not pull the SDL repository if not using bundled in build.rs
PR #1394 Fix static linking
PR #1389 Fix some undefined behavior.
PR #1378 BREAKING CHANGE Change
Keycodeto be a struct rather than an enum. FixKeycode::from_scancodefor non-QWERTY keyboard layouts.PR #1390 Apply clippy fixes, fix deprecations and other code quality improvements.
PR #1385 Upgrade raw-window-handle to 0.6.0
PR #1380 Add controller vendor_id() and product_id()
PR #1368 Remove unnecessary unsafe in Window interface. Make Window
Clone.PR #1366 Add Primary Selection bindings.
-
0.36.022 Nov 2023Release notes
Open source →PR #1270 BREAKING CHANGE Remove &mut self requirement in
TimerSubsystem::delay; AddTimerSubsystem::ticks64PR #1275 BREAKING CHANGE Update raw-window-handle to 0.5
PR #1225 Update wgpu to 0.12 in examples
PR #1250 Add
lib64to native library search path when using bundled featurePR #1240 BREAKING CHANGE Take
PixelMasksby referencePR #1254 BREAKING CHANGE Make
SdlDropandSubsystemDropsafer; forbid external code from constructingSdlDropPR #1318 Add NV12, NV21 to PixelFormatEnum
PR #1332 Fix
size_hintimplementations for{audio,video,render}::DriverIteratorPR #1333 Implement
FusedIterator,DoubleEndedIterator,and nth[_back]for{audio,video,render}::DriverIteratorPR #1337 Fix "Cannot initialize Sdl from more than one thread" for tests / CI
PR #1346 Add basic Shaped Window support
PR #1314 Add "ALWAYS ON TOP" support for X11
-
0.35.206 Feb 2022Release notes
Open source →PR #1173 Fix segfault when using timer callbacks
PR #1183 WinRT support for raw-window-handle
PR #1182 Updated raw-window-handle to 0.4
PR #1189 Added
AudioQueue::queue_audioand deprecatedAudioQueue::queuePR #1164 Added raw-window-handle support for Android
PR #1165 Added binding for
SDL_GetDisplayOrientationandSDL_DISPLAYEVENT -
0.35.125 Oct 2021Nothing published for this version
-
0.35.018 Oct 2021Release notes
Open source →-
BREAKING CHANGE Update
sdl2-sys/sdl_bindings.rsto use enums instead of consts. If you were usingsdl2-sys's enum variants directly in your project, you may be affected. If you only used sdl2 calls, there should not be any problems. -
BREAKING CHANGE SDL 2.0.14 or higher is now recommended due to the new binding being added for
SDL_OpenURL. If you get linking errors, upgrade your SDL2 libraries, or swap to using thebundledfeature.
PR #1138 Added binding for
SDL_OpenURLPR #1150 Do not download SDL2 sources when using bundled feature
PR #1112 Add wrapper functions for
SDL_RenderSetIntegerScaleandSDL_RenderGetIntegerScalePR #1156 Maybe breaking change: new variants to enum
GameController, and prevent panic with unrecognized buttons.PR #1153
SDL_GL_GetCurrentContextandSDL_RenderFlushadded.PR #1131 Added Sensor API.
-
-
0.34.527 Apr 2021Release notes
Open source →PR #1100 Added binding for
SDL_GetDisplayUsableBoundsPR #1102 Correctly se linux and macSO built libraries when using bundled without static-link.
PR #1098 Fix potential heap corruption when using AudioCVT::convert
PR #1088 Rollback of PR #1081: Broke dynamic linking on Windows
Various fixes to CI.
-
0.34.402 Apr 2021Release notes
Open source →PR #1086 Update bundled to use SDL2 2.0.14
PR #1033 Changed signature of TimerSubsystem::ticks to accept
&self.PR #1057: fix memory safety bug in set_error
PR #1081: Allow bundled build to be built in debug mode. Fixes issue when linking binary with mixed debug+release CRT dependencies.
PR #1080: Fix line endings of patches to lf so patching of sources works on Windows.
PR #1031: Add patch to fix metal detection (https://bugzilla.libsdl.org/show_bug.cgi?id=4988)
-
0.34.324 Aug 2020 -
0.34.227 Jun 2020Release notes
Open source →PR #1012 Fix use after free with AudioDevice::open and AudioDevice::open_queue
PR #1010 Fix compilation with gcc10.
PR #1009 Add support for linking to development libraries from vcpkg, and automatically setting up a vcpkg installation using
cargo-vcpkg. -
0.34.107 Jun 2020Release notes
Open source →PR #1004 + PR #1005: Add convenience functions for Window and Event.
PR #996: Impl
From<i32>forWindowPos.PR #988: Add convenience functions for
Texture. -
0.34.025 Apr 2020Release notes
Open source →PR #962: Added
raw-window-handlesupport for Windows, Linux (X11 and Wayland) and macOS.PR #964: Breaking change: Change joystick instance IDs from i32 to u32.
PR #965: Added invert method for Color, and added more Color names as constants.
PR #968 Pass SDL2 include directories to
sdl2-sys's dependant crates throughDEP_SDL2_INCLUDE.PR #970 Add
Chunk::from_bufferin mixer.PR #976 Fix compilation with
use-bingenfeature.PR #977 Add
cpuinfo::has_avx2andcpuinfo::has_avx512fPR #982 Support for loading Opus format in mixer.
PR #980 Fix compilation on Windows.
-
0.33.024 Jan 2020Nothing published for this version
-
0.32.204 Apr 2019Release notes
Open source →PR #868: Added inplace operations for
rect::Point.PR #827: Added 32-bit array pixelformats
PR #824: Added
controller::set_rumbleandjoystick::set_rumble, wrappers forSDL_GameControllerRumbleandSDL_JoystickRumblerespectively.PR #867: Added
Window::opacityandWindow::set_opacity, wrappers forSDL_GetWindowOpacityandSDL_SetWindowOpacityrespectively. This bumps the minimumSDL2version requirement from2.0.4to2.0.5. -
0.32.123 Dec 2018Nothing published for this version
-
0.32.006 Dec 2018Nothing published for this version
-
0.32.0-beta.210 Oct 2018 pre-releaseNothing published for this version
-
0.32.0-beta09 Oct 2018 pre-releaseNothing published for this version
-
0.31.009 Nov 2017Nothing published for this version
-
0.30.014 May 2017Nothing published for this version
-
0.30.0-beta05 May 2017 pre-releaseNothing published for this version
-
0.29.105 Apr 2017Nothing published for this version
-
0.29.014 Feb 2017Nothing published for this version
-
0.28.017 Jan 2017Nothing published for this version
-
0.27.306 Jan 2017Nothing published for this version
-
0.27.223 Dec 2016Nothing published for this version
-
0.27.121 Dec 2016Nothing published for this version
-
0.27.009 Dec 2016Nothing published for this version
-
0.26.029 Nov 2016 -
0.25.005 Nov 2016Nothing published for this version
-
0.24.007 Oct 2016Nothing published for this version
-
0.23.012 Sep 2016Nothing published for this version
-
0.22.028 Jul 2016Nothing published for this version
-
0.21.005 Jul 2016Nothing published for this version
-
0.20.106 Jun 2016Nothing published for this version
-
0.20.003 Jun 2016Nothing published for this version
-
0.19.003 May 2016Nothing published for this version
-
0.18.014 Apr 2016Nothing published for this version
-
0.17.029 Mar 2016Nothing published for this version
-
0.16.119 Mar 2016Nothing published for this version
-
0.16.003 Mar 2016Nothing published for this version
-
0.15.022 Feb 2016Nothing published for this version
-
0.14.010 Feb 2016Nothing published for this version
-
0.13.006 Jan 2016Nothing published for this version
-
0.12.205 Jan 2016 withdrawnNothing published for this version
-
0.12.114 Dec 2015Nothing published for this version
-
0.12.027 Nov 2015Nothing published for this version
-
0.11.017 Nov 2015Nothing published for this version
-
0.10.010 Nov 2015Nothing published for this version
-
0.9.107 Sep 2015Nothing published for this version
-
0.9.031 Aug 2015Nothing published for this version
-
0.8.012 Aug 2015Nothing published for this version
-
0.7.003 Aug 2015Nothing published for this version
-
0.6.127 Jul 2015Nothing published for this version
-
0.6.022 Jul 2015Nothing published for this version
-
0.5.022 Jun 2015Nothing published for this version
-
0.4.026 May 2015Nothing published for this version
-
0.3.018 May 2015Nothing published for this version
-
0.2.324 Apr 2015Nothing published for this version
-
0.2.223 Apr 2015Nothing published for this version