A practical guide to wrapping SDL2 C-style resource pointers with C++ shared_ptr to automate cleanup. By defining overloaded SDL_DelRes functions and a template helper sdl_shared, each SDL resource (window, renderer, texture, surface) is automatically released via the correct SDL function when the shared_ptr goes out of scope,

3m read timeFrom galowicz.de
Post cover image
Table of contents
Typical C-Style SDL CodeUsing shared_ptr to Automate Resource Handling

Sort: