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,
Sort: