I am currently having a problem saving the SDL_Window pointer as std :: unique_ptr.
I have tried:
std::unique_ptr<SDL_Window> window_;
Decision:
std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window_;
The first attempt continued to throw errors in the memory header, saying that SDL_Window is an incomplete type. Well, I know that SDL_Window is a structure and cannot be called using
SDL_Window* window_ = new SDL_Window();
therefore, initialization is done using SDL_CreateWindow (params).
Questions :
- Why can't I call the default constructor (or any other) for SDL_Window?
Why unique_ptr needs deleter in this case, but not here:
renderSystem_ = std::unique_ptr<Renderer::RenderSystem>(new Renderer::RenderSystem());
RenderSystem - , .
, unique_ptr , deleter ?
!