I would like to know how can I connect SDL_Surface * with shared_ptr?I need to call SDL_FreeSurface(SDL_Surface*) before I remove SDL_Surface . How can I "change the delete process" in shared_ptr?
SDL_FreeSurface(SDL_Surface*)
SDL_Surface
Just pass SDL_FreeSurface to the constructor:
std::shared_ptr<SDL_Surface> shared_surf(SDL_LoadBMP("foo.bmp"), SDL_FreeSurface);
Just make sure you don't do this with the pointer returned by SDL_SetVideoMode or SDL_GetVideoSurface .
SDL_SetVideoMode
SDL_GetVideoSurface
Source: https://habr.com/ru/post/912342/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/912337/git-repository-not-recognized-during-rails-deploy-with-capistrano&usg=ALkJrhhkaLVGklwz72g3PyB4Xjs3yBDP7wWhat is `edit` attr in the meta tag - htmlRemove Signature Signature Signatures - htmlUsing the RTMP_Write Function - flvhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/912341/how-to-force-base-class-constructors-to-be-called-in-derived-classes&usg=ALkJrhhWAUgEmYAvYE65vIKVXFJgR3CFDAHow to manage a Python script portable without specifying its full path - pythonHow to upload a file to ASP.NET MVC from a console application - c #IE8 Compatibility Mode - cssProperty name Copy attribute does not match property inherited from MKnnotation - propertiesg ++ will not work on Lion - compilationAll Articles