Add Bitmap::SaveSurfaceToFile
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -28,7 +28,7 @@ class Bitmap {
|
||||
void Create(int width, int height, int depth, int data_size);
|
||||
void Create(int width, int height, int depth, uchar *data, int data_size);
|
||||
void Create(int width, int height, int depth, Bytes data);
|
||||
|
||||
|
||||
void CreateFromSurface(SDL_Surface *surface);
|
||||
|
||||
void Apply(Bytes data);
|
||||
@@ -36,6 +36,7 @@ class Bitmap {
|
||||
void CreateTexture(std::shared_ptr<SDL_Renderer> renderer);
|
||||
void UpdateTexture(std::shared_ptr<SDL_Renderer> renderer);
|
||||
|
||||
void SaveSurfaceToFile(std::string_view filename);
|
||||
void SetSurface(SDL_Surface *surface);
|
||||
|
||||
void ApplyPalette(const SNESPalette &palette);
|
||||
|
||||
Reference in New Issue
Block a user