tinfoil hat

This commit is contained in:
scawful
2022-09-03 18:30:12 -05:00
parent 2fa0908111
commit c623230861

View File

@@ -46,8 +46,14 @@ class Bitmap {
private: private:
struct sdl_deleter { struct sdl_deleter {
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); } void operator()(SDL_Texture *p) const {
void operator()(SDL_Surface *p) const { SDL_FreeSurface(p); } SDL_DestroyTexture(p);
p = nullptr;
}
void operator()(SDL_Surface *p) const {
SDL_FreeSurface(p);
p = nullptr;
}
}; };
int width_ = 0; int width_ = 0;
@@ -57,8 +63,8 @@ class Bitmap {
bool freed_ = false; bool freed_ = false;
uchar *pixel_data_; uchar *pixel_data_;
Bytes data_; Bytes data_;
std::shared_ptr<SDL_Texture> texture_; std::shared_ptr<SDL_Texture> texture_ = nullptr;
std::shared_ptr<SDL_Surface> surface_; std::shared_ptr<SDL_Surface> surface_ = nullptr;
}; };
} // namespace gfx } // namespace gfx