#ifndef OPENDIABLO2_D2GRAPHICS_H #define OPENDIABLO2_D2GRAPHICS_H #include #include #include namespace OpenDiablo2 { namespace System { struct SDLWindowDestroyer { void operator()(SDL_Window* w) const { spdlog::debug("Destroying SDL window"); if (w) SDL_DestroyWindow(w); } }; struct SDLRendererDestroyer { void operator()(SDL_Renderer* r) const { spdlog::debug("Destroying SDL renderer"); if (r) SDL_DestroyRenderer(r); } }; class D2Graphics { public: typedef std::unique_ptr Ptr; D2Graphics(); void InitializeWindow(); void Clear(); void Present(); private: std::unique_ptr window; std::unique_ptr renderer; }; } } #endif //OPENDIABLO2_D2GRAPHICS_H