Open nhurde opened 5 months ago
After giving it a quick look, here's a list of things in no particular order.
Add code examples. I would personally expect the examples
directory to contain code that shows how you got the resulting gifs, even just to illustrate how you'd use the functions.
Add some protection against symbol redefinition. Currently, the header lacks any form of include guard, and defines no way to hide implementation. About that latter point, it's typical for header-only libraries in C to have the implementation of functions hidden behind a MYLIB_IMPLEMENTATION
define with the documentation stating something along the lines of:
Do this:
#define MYLIB_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
Is this supposed to work with C ? It is a .h
file, but uses things like the cmath
header, the bool
type, and default function arguments. If C support is desired, SDL offers its own math functions and boolean type.
The naming is... Odd ? Some functions are prefixed with SDL2_RenderParty_
, while others lack the 2
. I am also, personally, not fond of starting function names with SDL_
because it feels like you're stepping in SDL's "namespace". So maybe have the functions be prefixed with SRP_
or just RP_
, but that's very much a matter of taste.
Support for some buildsystem. While this is a header-only library and does not need to be built, I do think something like a simple CMake script could be useful:
Please comment below for any changes for next version you may see within the single header file.