The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
C++ binding
markand


Joined: 11 Jun 2012
Posts: 31
On 26/02/2014 18:42, Dmitry Marakasov wrote:
Quote:
* Ivan Rubinson wrote:

Quote:
Sure, the C API works great with C++ out of the box, but there are some
things that could be done more conveniently.
A quick google fails to locate any C++ bindings / wrappers of the C API; so
I wonder if anybody is interested in it.

The benefits of C++:
- RAII <3
- Easier to use API for renderers
- Anything you want to add?
- Better error handling

Quote:
The idea is to make a thin but elegant wrapper that could be (at least
mostly) optimized out by the compiler. This would make programming with SDL
a lot more fun.

If there's sufficient interest, then I think I'll work on that.
You may find my work useful:

https://github.com/AMDmi3/libSDL2pp

Hi,

The binding looks great, however I saw that you used raw pointer of
SDL_Window in the Window class. You disable the copy constructor. I
would rather use a std::unique_ptr<> with the custom deleter for that
purpose or better a std::shared_ptr so that Window can be safely copied
and destroyed when required.

Regards,
David.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org