Nim bindings for Simple and Fast Multimedia Library (through CSFML).
See examples, introduction, documentation.
The majority of the library is generated from CSFML's header files, using custom Python scripts made just for this, that take every detail into account. I do not manually edit the generated files, just add more functionality on top of them. This means that the library is very easy to maintain, because anytime CSFML gets an update, I can just re-generate the wrapper, and that does 90%-100% of the work. It also means that mistakes in the library are less likely, and if some bad quality is detected, changes can easily be applied to every part of it.
The library is easy and pleasant to use. Destructors are enabled, so you don't need to manually destroy the objects. Instead of setter functions, the special setter syntax is used. Unicode is supported, and normal UTF-8 strings are automatically converted to 32-bit Unicode sequences used by SFML.
It is well documented: again, the documentation of generated modules is taken directly from CSFML (and adapted to look nice, of course), and the additional functionality is also documented.
Yes, there is already a library that does the same thing, but I found it unpleasant to use. It seems to be generated by c2nim, then edited by hand, which makes it error-prone and hard to maintain (and the author does not seem to have time for it). It lacks Unicode support, documentation, allows memory leaks, has those T/P letters everywhere, and sometimes makes you convert between object and ptr types. There are multiple smaller problems too.
I think I achieved a better result by starting anew than I would by contributing there.
Great -- looks really nice and clean.
Currently I do not fully understand why you need the cdecl pragma for many procs, while you seem to be able to avoid the dynlib pragma by push operation. (My current solution to avoid clutter for GTK was defining my own pragma, so I had to use myownprag plus the importc pragma for each proc. Your solution seems to be more clean already. For GTK I tried to apply scripts also, but it worked not always very good, because of the long history of GTK and a lot of strange macro-like constructs.)
Have you already defined a converter BoolInt <-> bool so that BoolInt can be uses like Nim's bool?
[EDIT]
Destructors are enabled, so you don't need to manually destroy the objects.
Great. I still have to learn how to do that...
[EDIT2]
OK, found your converters, in csfml_util.nim
Stefan_Salewski, I imagine that cdecl is the main pragma while dynlib and importc are the arguments, so they are probably just ignored if they do not apply. It may be possible to get rid of cdecl as well, or maybe by pushing it to everything strange effects may appear. I actually haven't tried.
EDIT: This all seems to be fiction :P
Still, it's nice to have cdecl in documentation, because calling convention often matters.