21 return *SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888)->format;
34 throw std::invalid_argument(
"Creating surface with negative dimensions");
43 && SDL_ISPIXELFORMAT_INDEXED(
surface_->format->format) == SDL_FALSE
44 &&
surface_->format->BytesPerPixel == 4
111 if(dst2.w == 0 || dst2.h == 0) {
152 stream <<
"<null surface>";
153 }
else if(!surf->format) {
154 stream <<
"<invalid surface>";
156 stream <<
"{ " << surf->w <<
'x' << surf->h <<
'@' 157 << unsigned(surf->format->BitsPerPixel) <<
"bpp" 158 << (surf->format->palette ?
" indexed" :
"")
159 <<
" clip_rect=[" << surf->clip_rect
160 <<
"] refcount=" << surf->refcount
SDL_Surface * get() const
const uint32_t SDL_ALPHA_MASK
surface read_pixels_low_res(SDL_Rect *r=nullptr)
The same as read_pixels, but returns a low-resolution surface suitable for use with the old drawing s...
bool operator<(const surface &a, const surface &b)
static void add_surface_ref(SDL_Surface *surf)
SDL_Rect intersect_rects(const SDL_Rect &rect1, const SDL_Rect &rect2)
Calculates the intersection of two rectangles.
void assign_surface_internal(SDL_Surface *surf)
surface clone() const
Makes a copy of this surface.
const uint32_t SDL_RED_MASK
void blit_surface(const surface &surf, SDL_Rect *dst)
Draws a surface at the given location.
surface & make_neutral()
Converts this surface to a neutral format if it is not already.
bool is_neutral() const
Check that the surface is neutral bpp 32.
Contains the SDL_Rect helper code.
constexpr const SDL_Rect empty_rect
static const SDL_PixelFormat neutral_pixel_format
std::ostream & operator<<(std::ostream &stream, const surface &surf)