Cargo Features

SDL2 has no features set by default.

[dependencies]
sdl2 = { version = "0.37.0", features = ["unsafe_textures", "gfx", "mixer", "image", "ttf", "hidapi", "use-bindgen", "use-pkgconfig", "use-vcpkg", "use_mac_framework", "bundled", "static-link", "raw-window-handle"] }
unsafe_textures

Affects render::Texture

gfx = c_vec

Enables gfx of sdl2-sys

Affects sdl2::gfx

mixer

Enables mixer of sdl2-sys

Affects sdl2::mixer

image

Enables image of sdl2-sys

Affects sdl2::image

ttf

Enables ttf of sdl2-sys

Affects sdl2::ttf

hidapi

Use hidapi support in SDL. Only 2.0.12 and after

Affects sdl2::sensor

use-bindgen

Enables use-bindgen of sdl2-sys

use-pkgconfig

Enables use-pkgconfig of sdl2-sys

use-vcpkg

Enables use-vcpkg of sdl2-sys

use_mac_framework

Enables use_mac_framework of sdl2-sys

bundled

Enables bundled of sdl2-sys

Enables static-link of sdl2-sys

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

raw-window-handle implicit feature

Enables raw-window-handle

raw-window-handle:

Interoperability library for Rust Windowing applications

Affects sdl2::raw_window_handle

c_vec gfx?