I really have no problem with SDL in C , but it's kind of tiring. Using structs doing stuff without classes, or worse, having to wrap the functions up in a class yourself etc. I was wondering whether there was a good , mature , well-designed (i.e NO Macros , using templates and the STL) wrapper (binding?) for SDL?
SDLmm is a C++ wrapper for SDL. I'm not sure when it was last updated though and I can't vouch for the style of C++ used either.
You could check out https://github.com/AMDmi3/libSDL2pp. It is C++11/14 binding for SDL2 and related libraries (SDL2_ttf, SDL2_image). Seems like it also satisfies your style requirements - it makes much use of modern C++ features and seem to generally provides safe and easy way of using SDL2 primitives.
SDLmm is a C++ wrapper for SDL. I'm not sure when it was last updated though and I can't vouch for the style of C++ used either.
Pardon the personal plug, but I've been working on just such a library.
https://github.com/CYBORUS/cyborus-game-engine/tree/master/CGE
It was not my original intent to release it to the world, so it lacks documentation. However, if there were enough interest, I would be more than happy to spin off this CGE folder into its own project.
(CGE stands for CYBORUS Game Engine. It does precisely what you are asking for. For example, it keeps SDL_Surface structs safely inside a class CGE::Image.)
© 2022 - 2024 — McMap. All rights reserved.