Is There A C++ Wrapper / Binding For SDL? [closed]
Asked Answered
H

3

6

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?

Hultin answered 8/10, 2011 at 9:14 Comment(0)
S
0

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.

Shiv answered 8/10, 2011 at 9:18 Comment(0)
J
5

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.

Jainism answered 24/2, 2015 at 19:33 Comment(0)
S
0

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.

Shiv answered 8/10, 2011 at 9:18 Comment(0)
A
0

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.)

Adamic answered 10/10, 2011 at 14:57 Comment(8)
What license is it under? hope it's not commercial.Hultin
Thus far, I intended to make it GPLv3 or LGPLv3. What kind of license do you need? It is open source, so you are free to read over any of it and take ideas from it.Adamic
Thanks. The source is clear and helpful, though I think u've gone a little overboard with encapsulation.Hultin
Ha, what do you mean? I welcome all feedback. How did I go overboard? 99% of the time, developers FAIL to use proper encapsulation. :]Adamic
I explain the general architecture here. youtube.com/watch?v=eCdPfQD0X-E and youtube.com/watch?v=uYgQf0Aim8UAdamic
Is this project still alive? Does it have a documentation?Psychodrama
Sorry. It got moved. github.com/CYBORUS/cyborus-game-engine/tree/master/CGE Yes, it is alive (somewhat). I cannot say when it will have documentation, but I am OK with answering any questions you might have.Adamic
@Adamic It'd be awfully generous of you to spend a chunk of time writing some docs; you're currently a result off google and it'd be easier to use with some docsPrawn

© 2022 - 2024 — McMap. All rights reserved.