beryllium
An opinionated set of "high level" wrappers for the fermium SDL2 bindings.
Mindset
I attempt to make things as safe as is reasonable, without actually doing anything that would hurt the API design.
Building
Obviously this uses SDL2. You need version 2.0.9 or later:
- On Windows the necessary files are provided automatically, and you don't need to do any special setup at all.
- On non-Windows you need to have installed SDL2 yourself ahead of time:
- You'll need the
-fPIC
flag enabled in your SDL2 install! This is necessary because the build will static link to SDL2 by default. - On macOS you should simply use homebrew, it does everything correctly with no fuss.
- On Linux you can use the installer script in this repo.
Either run it as is with
sudo
for a default install (to/usr/local/lib
) or adjust it to fit your needs. Linux programmer are all pros, right?
- You'll need the
fermium
does a static binding by default, so once you build your program it
won't depend on SDL2 files any longer.
Also, somewhat related, you'll probably want to set the window_subsystem to "windows" in your beryllium programs. Just add this to the top of the main file of any binary or example:
Note that we only want it enabled when debug_assertions
are not active. If
it's configured you don't have a default console at all so you can't print
debug messages. We only need to set it with the version we plan to ship to
users.
License
This crate uses the Zlib license, the same license that SDL2 itself uses.