Add Bitmap::SaveSurfaceToFile

This commit is contained in:
scawful
2023-08-18 10:27:50 -04:00
parent b0df91b7d5
commit 26f6531c9d
2 changed files with 6 additions and 1 deletions

View File

@@ -137,6 +137,10 @@ void Bitmap::UpdateTexture(std::shared_ptr<SDL_Renderer> renderer) {
SDL_Texture_Deleter{}};
}
void Bitmap::SaveSurfaceToFile(std::string_view filename) {
SDL_SaveBMP(surface_.get(), filename.data());
}
void Bitmap::SetSurface(SDL_Surface *surface) {
surface_ = std::unique_ptr<SDL_Surface, SDL_Surface_Deleter>(
surface, SDL_Surface_Deleter());