diff --git a/MiniEngine.cpp b/MiniEngine.cpp index 783067f..a9b235a 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -150,6 +150,11 @@ namespace MiniEngine op.reset(SDL_RWFromMem(mem,size),[](SDL_RWops* p){SDL_RWclose(p);}); } + int Surface::savePNG(const std::string& filename) + { + return IMG_SavePNG(surf.get(),filename.c_str()); + } + Texture::Texture() { updateInfo(); diff --git a/MiniEngine.h b/MiniEngine.h index 6cb3d2e..96db246 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -85,7 +85,6 @@ namespace MiniEngine std::shared_ptr op; }; - enum class BlendMode { None = SDL_BLENDMODE_NONE, @@ -98,6 +97,7 @@ namespace MiniEngine { public: ~Surface() = default; + int savePNG(const std::string& filename); protected: Surface() = default; private: