[−][src]Crate fermium
The fermium
crate is raw bindings to the SDL2 C API.
Compared to the common alternative, sdl2-sys, this is has consts instead of enums, it is slightly more complete, and it works much better on windows MSVC (no special setup at all).
Depending on how you configure the crate, you can target a minimum SDL2 version of 2.0.8 or later. You can compile against a later version than your minimum bind version, but not an earlier one, so for best compatability you should target the earliest SDL2 API version you can. The current version of SDL2 in Ubuntu 18 is 2.0.8, and Debian Stable has 2.0.9, so we don't at this time bother to support SDL2 versions before 2.0.8.
bindgen
is used to generate the bindings from the official SDL2 include
files. At the moment we include the following SDL2 headers:
SDL2.h
SDL_syswm.h
SDL_vulkan.h
However, SDL_syswm.h
in particular pulls in a bunch of extra code and it
overwhelms the generated bindings. To avoid this, we only keep the following
whitelist of items:
SDL_
(functions, types, and vars)SDLK_
(vars)AUDIO_
(vars)- Any other items that the above depend on.
It is thought that this will expose all needed functionality, but if you think something should be added to the whitelist please submit an issue.
Docs
Bindgen doesn't understand how to convert doxygen style docs into rustdoc style docs. What it does generate makes rustdoc think there a bunch of random code block all over that it should run as test cases. Sadly, rustdoc has no way to turn this off, so I have to tell bindgen to just emit no docs at all.
Instead you should check out the SDL2 Wiki
Structs
Enums
c_void |
Constants
Functions
Type Definitions
Unions
SDL_Event | |
SDL_GameControllerButtonBind__bindgen_ty_1 | |
SDL_HapticEffect | |
SDL_RWops__bindgen_ty_1 | |
SDL_SysWMinfo__bindgen_ty_1 | |
SDL_SysWMmsg__bindgen_ty_1 | |
SDL_WindowShapeParams |