34 SDL_DestroySurface(
surf);
40 if(
surf &&
surf->format != SDL_PIXELFORMAT_ARGB8888) {
57 throw std::invalid_argument(
"Creating surface with negative dimensions");
60 surface_ = SDL_CreateSurface(
w,
h, SDL_PIXELFORMAT_ARGB8888);
70 : surface_(std::exchange(
s.surface_,
nullptr))
93 surface_ = std::exchange(
s.surface_,
nullptr);
123 stream <<
"<null surface>";
124 }
else if(!
surf->format) {
125 stream <<
"<invalid surface>";
127 const SDL_PixelFormatDetails* details = SDL_GetPixelFormatDetails(
surf->format);
129 stream <<
"{ " <<
surf->w <<
'x' <<
surf->h <<
'@'
130 << details->bits_per_pixel <<
"bpp"
131 << (SDL_GetSurfacePalette(
surf)->colors ?
" indexed" :
"")
132 <<
" refcount=" <<
surf->refcount
point size() const
Dimensions of the surface.
surface clone() const
Creates a new, duplicate surface in memory using the 'neutral' pixel format.
SDL_Surface * get() const
std::size_t area() const
Total area of the surface in square pixels.
surface & operator=(const surface &s)
Contains the SDL_Rect helper code.
std::ostream & operator<<(std::ostream &stream, const surface &surf)
static map_location::direction s