SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
Surface Creation and Simple Drawing

SDL surfaces are buffers of pixels in system RAM. More...

Collaboration diagram for Surface Creation and Simple Drawing:

Classes

struct  SDL::SurfaceParam
 Safely wrap Surface for non owning parameters. More...
 
struct  SDL::SurfaceConstParam
 Safely wrap Surface for non owning const parameters. More...
 
class  SDL::Surface
 A collection of pixels used in software blitting. More...
 

Typedefs

using SDL::SurfaceRaw = SDL_Surface *
 Alias to raw representation for Surface.
 
using SDL::SurfaceFlags = Uint32
 The flags on an Surface. More...
 
using SDL::ScaleMode = SDL_ScaleMode
 The scaling mode. More...
 
using SDL::FlipMode = SDL_FlipMode
 The flip mode. More...
 

Functions

constexpr bool SDL::MUSTLOCK (SurfaceConstParam S)
 Evaluates to true if the surface needs to be locked before access. More...
 
Surface SDL::CreateSurface (const PointRaw &size, PixelFormat format)
 Allocate a new surface with a specific pixel format. More...
 
Surface SDL::CreateSurfaceFrom (const PointRaw &size, PixelFormat format, void *pixels, int pitch)
 Allocate a new surface with a specific pixel format and existing pixel data. More...
 
void SDL::DestroySurface (SurfaceRaw surface)
 Free a surface. More...
 
PropertiesRef SDL::GetSurfaceProperties (SurfaceConstParam surface)
 Get the properties associated with a surface. More...
 
void SDL::SetSurfaceColorspace (SurfaceParam surface, Colorspace colorspace)
 Set the colorspace used by a surface. More...
 
Colorspace SDL::GetSurfaceColorspace (SurfaceConstParam surface)
 Get the colorspace used by a surface. More...
 
Palette SDL::CreateSurfacePalette (SurfaceParam surface)
 Create a palette and associate it with a surface. More...
 
void SDL::SetSurfacePalette (SurfaceParam surface, PaletteParam palette)
 Set the palette used by a surface. More...
 
Palette SDL::GetSurfacePalette (SurfaceConstParam surface)
 Get the palette used by a surface. More...
 
void SDL::AddSurfaceAlternateImage (SurfaceParam surface, SurfaceParam image)
 Add an alternate version of a surface. More...
 
bool SDL::SurfaceHasAlternateImages (SurfaceConstParam surface)
 Return whether a surface has alternate versions available. More...
 
OwnArray< SurfaceRawSDL::GetSurfaceImages (SurfaceConstParam surface)
 Get an array including all versions of a surface. More...
 
void SDL::RemoveSurfaceAlternateImages (SurfaceParam surface)
 Remove all alternate versions of a surface. More...
 
void SDL::LockSurface (SurfaceParam surface)
 Set up a surface for directly accessing the pixels. More...
 
void SDL::UnlockSurface (SurfaceParam surface)
 Release a surface after directly accessing the pixels. More...
 
Surface SDL::LoadBMP (IOStreamParam src, bool closeio=false)
 Load a BMP image from a seekable SDL data stream. More...
 
Surface SDL::LoadBMP (StringParam file)
 Load a BMP image from a file. More...
 
void SDL::SaveBMP (SurfaceConstParam surface, IOStreamParam dst, bool closeio=false)
 Save a surface to a seekable SDL data stream in BMP format. More...
 
void SDL::SaveBMP (SurfaceConstParam surface, StringParam file)
 Save a surface to a file. More...
 
void SDL::SetSurfaceRLE (SurfaceParam surface, bool enabled)
 Set the RLE acceleration hint for a surface. More...
 
bool SDL::SurfaceHasRLE (SurfaceConstParam surface)
 Returns whether the surface is RLE enabled. More...
 
void SDL::SetSurfaceColorKey (SurfaceParam surface, std::optional< Uint32 > key)
 Set the color key (transparent pixel) in a surface. More...
 
bool SDL::SurfaceHasColorKey (SurfaceConstParam surface)
 Returns whether the surface has a color key. More...
 
std::optional< Uint32SDL::GetSurfaceColorKey (SurfaceConstParam surface)
 Get the color key (transparent pixel) for a surface. More...
 
void SDL::SetSurfaceColorMod (SurfaceParam surface, Uint8 r, Uint8 g, Uint8 b)
 Set an additional color value multiplied into blit operations. More...
 
void SDL::GetSurfaceColorMod (SurfaceConstParam surface, Uint8 *r, Uint8 *g, Uint8 *b)
 Get the additional color value multiplied into blit operations. More...
 
void SDL::SetSurfaceAlphaMod (SurfaceParam surface, Uint8 alpha)
 Set an additional alpha value used in blit operations. More...
 
Uint8 SDL::GetSurfaceAlphaMod (SurfaceConstParam surface)
 Get the additional alpha value used in blit operations. More...
 
void SDL::SetSurfaceBlendMode (SurfaceParam surface, BlendMode blendMode)
 Set the blend mode used for blit operations. More...
 
BlendMode SDL::GetSurfaceBlendMode (SurfaceConstParam surface)
 Get the blend mode used for blit operations. More...
 
bool SDL::SetSurfaceClipRect (SurfaceParam surface, OptionalRef< const RectRaw > rect)
 Set the clipping rectangle for a surface. More...
 
Rect SDL::GetSurfaceClipRect (SurfaceConstParam surface)
 Get the clipping rectangle for a surface. More...
 
void SDL::FlipSurface (SurfaceParam surface, FlipMode flip)
 Flip a surface vertically or horizontally. More...
 
Surface SDL::DuplicateSurface (SurfaceConstParam surface)
 Creates a new surface identical to the existing surface. More...
 
Surface SDL::ScaleSurface (SurfaceConstParam surface, const PointRaw &size, ScaleMode scaleMode)
 Creates a new surface identical to the existing surface, scaled to the desired size. More...
 
Surface SDL::ConvertSurface (SurfaceConstParam surface, PixelFormat format)
 Copy an existing surface to a new surface of the specified format. More...
 
Surface SDL::ConvertSurfaceAndColorspace (SurfaceConstParam surface, PixelFormat format, PaletteParam palette, Colorspace colorspace, PropertiesParam props)
 Copy an existing surface to a new surface of the specified format and colorspace. More...
 
void SDL::ConvertPixels (const PointRaw &size, PixelFormat src_format, const void *src, int src_pitch, PixelFormat dst_format, void *dst, int dst_pitch)
 Copy a block of pixels of one format to another format. More...
 
void SDL::ConvertPixelsAndColorspace (const PointRaw &size, PixelFormat src_format, Colorspace src_colorspace, PropertiesParam src_properties, const void *src, int src_pitch, PixelFormat dst_format, Colorspace dst_colorspace, PropertiesParam dst_properties, void *dst, int dst_pitch)
 Copy a block of pixels of one format and colorspace to another format and colorspace. More...
 
void SDL::PremultiplyAlpha (const PointRaw &size, PixelFormat src_format, const void *src, int src_pitch, PixelFormat dst_format, void *dst, int dst_pitch, bool linear)
 Premultiply the alpha on a block of pixels. More...
 
void SDL::PremultiplySurfaceAlpha (SurfaceParam surface, bool linear)
 Premultiply the alpha in a surface. More...
 
void SDL::ClearSurface (SurfaceParam surface, const FColorRaw &color)
 Clear a surface with a specific color, with floating point precision. More...
 
void SDL::FillSurfaceRect (SurfaceParam dst, OptionalRef< const RectRaw > rect, Uint32 color)
 Perform a fast fill of a rectangle with a specific color. More...
 
void SDL::FillSurfaceRects (SurfaceParam dst, SpanRef< const RectRaw > rects, Uint32 color)
 Perform a fast fill of a set of rectangles with a specific color. More...
 
void SDL::BlitSurface (SurfaceParam src, OptionalRef< const RectRaw > srcrect, SurfaceParam dst, OptionalRef< const RectRaw > dstrect)
 Performs a fast blit from the source surface to the destination surface with clipping. More...
 
void SDL::BlitSurfaceAt (SurfaceParam src, OptionalRef< const RectRaw > srcrect, SurfaceParam dst, const PointRaw &dstpos)
 Performs a fast blit from the source surface to the destination surface with clipping. More...
 
void SDL::BlitSurfaceUnchecked (SurfaceParam src, const RectRaw &srcrect, SurfaceParam dst, const RectRaw &dstrect)
 Perform low-level surface blitting only. More...
 
void SDL::BlitSurfaceScaled (SurfaceParam src, OptionalRef< const RectRaw > srcrect, SurfaceParam dst, OptionalRef< const RectRaw > dstrect, ScaleMode scaleMode)
 Perform a scaled blit to a destination surface, which may be of a different format. More...
 
void SDL::BlitSurfaceUncheckedScaled (SurfaceParam src, const RectRaw &srcrect, SurfaceParam dst, const RectRaw &dstrect, ScaleMode scaleMode)
 Perform low-level surface scaled blitting only. More...
 
void SDL::StretchSurface (SurfaceParam src, OptionalRef< RectRaw > srcrect, SurfaceParam dst, OptionalRef< RectRaw > dstrect, ScaleMode scaleMode)
 Perform a stretched pixel copy from one surface to another. More...
 
void SDL::BlitSurfaceTiled (SurfaceParam src, OptionalRef< const RectRaw > srcrect, SurfaceParam dst, OptionalRef< const RectRaw > dstrect)
 Perform a tiled blit to a destination surface, which may be of a different format. More...
 
void SDL::BlitSurfaceTiledWithScale (SurfaceParam src, OptionalRef< const RectRaw > srcrect, float scale, SDL_ScaleMode scaleMode, SurfaceParam dst, OptionalRef< const RectRaw > dstrect)
 Perform a scaled and tiled blit to a destination surface, which may be of a different format. More...
 
void SDL::BlitSurface9Grid (SurfaceParam src, OptionalRef< const RectRaw > srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SurfaceParam dst, OptionalRef< const RectRaw > dstrect)
 Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format. More...
 
void SDL::BlitSurface9Grid (SurfaceParam src, OptionalRef< const RectRaw > srcrect, int left_width, int right_width, int top_height, int bottom_height, SurfaceParam dst, OptionalRef< const RectRaw > dstrect)
 Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format. More...
 
Uint32 SDL::MapSurfaceRGB (SurfaceConstParam surface, Uint8 r, Uint8 g, Uint8 b)
 Map an RGB triple to an opaque pixel value for a surface. More...
 
Uint32 SDL::MapSurfaceRGBA (SurfaceConstParam surface, ColorRaw c)
 Map an RGBA quadruple to a pixel value for a surface. More...
 
void SDL::ReadSurfacePixel (SurfaceConstParam surface, const PointRaw &p, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
 Retrieves a single pixel from a surface. More...
 
void SDL::ReadSurfacePixelFloat (SurfaceConstParam surface, const PointRaw &p, float *r, float *g, float *b, float *a)
 Retrieves a single pixel from a surface. More...
 
void SDL::WriteSurfacePixel (SurfaceParam surface, const PointRaw &p, ColorRaw c)
 Writes a single pixel to a surface. More...
 
void SDL::WriteSurfacePixelFloat (SurfaceParam surface, const PointRaw &p, const FColorRaw &c)
 Writes a single pixel to a surface. More...
 
void SDL::Surface::Destroy ()
 Free a surface. More...
 
PropertiesRef SDL::Surface::GetProperties () const
 Get the properties associated with a surface. More...
 
void SDL::Surface::SetColorspace (Colorspace colorspace)
 Set the colorspace used by a surface. More...
 
Colorspace SDL::Surface::GetColorspace () const
 Get the colorspace used by a surface. More...
 
Palette SDL::Surface::CreatePalette ()
 Create a palette and associate it with a surface. More...
 
void SDL::Surface::SetPalette (PaletteParam palette)
 Set the palette used by a surface. More...
 
Palette SDL::Surface::GetPalette () const
 Get the palette used by a surface. More...
 
void SDL::Surface::AddAlternateImage (SurfaceParam image)
 Add an alternate version of a surface. More...
 
bool SDL::Surface::HasAlternateImages () const
 Return whether a surface has alternate versions available. More...
 
OwnArray< SurfaceRawSDL::Surface::GetImages () const
 Get an array including all versions of a surface. More...
 
void SDL::Surface::RemoveAlternateImages ()
 Remove all alternate versions of a surface. More...
 
void SDL::Surface::Lock ()
 Set up a surface for directly accessing the pixels. More...
 
void SDL::Surface::Unlock ()
 Release a surface after directly accessing the pixels. More...
 
static Surface SDL::Surface::LoadBMP (IOStreamParam src, bool closeio=false)
 Load a BMP image from a seekable SDL data stream. More...
 
static Surface SDL::Surface::LoadBMP (StringParam file)
 Load a BMP image from a file. More...
 
void SDL::Surface::SaveBMP (IOStreamParam dst, bool closeio=false) const
 Save a surface to a seekable SDL data stream in BMP format. More...
 
void SDL::Surface::SaveBMP (StringParam file) const
 Save a surface to a file. More...
 
void SDL::Surface::SetRLE (bool enabled)
 Set the RLE acceleration hint for a surface. More...
 
bool SDL::Surface::HasRLE () const
 Returns whether the surface is RLE enabled. More...
 
void SDL::Surface::SetColorKey (std::optional< Uint32 > key)
 Set the color key (transparent pixel) in a surface. More...
 
bool SDL::Surface::HasColorKey () const
 Returns whether the surface has a color key. More...
 
std::optional< Uint32SDL::Surface::GetColorKey () const
 Get the color key (transparent pixel) for a surface. More...
 
void SDL::Surface::SetColorMod (Uint8 r, Uint8 g, Uint8 b)
 Set an additional color value multiplied into blit operations. More...
 
void SDL::Surface::GetColorMod (Uint8 *r, Uint8 *g, Uint8 *b) const
 Get the additional color value multiplied into blit operations. More...
 
void SDL::Surface::SetAlphaMod (Uint8 alpha)
 Set an additional alpha value used in blit operations. More...
 
Uint8 SDL::Surface::GetAlphaMod () const
 Get the additional alpha value used in blit operations. More...
 
void SDL::Surface::SetBlendMode (BlendMode blendMode)
 Set the blend mode used for blit operations. More...
 
BlendMode SDL::Surface::GetBlendMode () const
 Get the blend mode used for blit operations. More...
 
bool SDL::Surface::SetClipRect (OptionalRef< const RectRaw > rect)
 Set the clipping rectangle for a surface. More...
 
Rect SDL::Surface::GetClipRect () const
 Get the clipping rectangle for a surface. More...
 
void SDL::Surface::Flip (FlipMode flip)
 Flip a surface vertically or horizontally. More...
 
Surface SDL::Surface::Duplicate () const
 Creates a new surface identical to the existing surface. More...
 
Surface SDL::Surface::Scale (const PointRaw &size, ScaleMode scaleMode) const
 Creates a new surface identical to the existing surface, scaled to the desired size. More...
 
Surface SDL::Surface::Convert (PixelFormat format) const
 Copy an existing surface to a new surface of the specified format. More...
 
Surface SDL::Surface::Convert (PixelFormat format, PaletteParam palette, Colorspace colorspace, PropertiesParam props) const
 Copy an existing surface to a new surface of the specified format and colorspace. More...
 
void SDL::Surface::PremultiplyAlpha (bool linear)
 Premultiply the alpha in a surface. More...
 
void SDL::Surface::Clear (const FColorRaw &color)
 Clear a surface with a specific color, with floating point precision. More...
 
void SDL::Surface::FillRect (OptionalRef< const RectRaw > rect, Uint32 color)
 Perform a fast fill of a rectangle with a specific color. More...
 
void SDL::Surface::FillRects (SpanRef< const RectRaw > rects, Uint32 color)
 Perform a fast fill of a set of rectangles with a specific color. More...
 
void SDL::Surface::Blit (SurfaceParam src, OptionalRef< const RectRaw > srcrect, OptionalRef< const RectRaw > dstrect)
 Performs a fast blit from the source surface to the destination surface with clipping. More...
 
void SDL::Surface::BlitUnchecked (SurfaceParam src, const RectRaw &srcrect, const RectRaw &dstrect)
 Perform low-level surface blitting only. More...
 
void SDL::Surface::BlitScaled (SurfaceParam src, OptionalRef< const RectRaw > srcrect, OptionalRef< const RectRaw > dstrect, ScaleMode scaleMode)
 Perform a scaled blit to a destination surface, which may be of a different format. More...
 
void SDL::Surface::BlitUncheckedScaled (SurfaceParam src, const RectRaw &srcrect, const RectRaw &dstrect, ScaleMode scaleMode)
 Perform low-level surface scaled blitting only. More...
 
void SDL::Surface::Stretch (SurfaceParam src, OptionalRef< RectRaw > srcrect, OptionalRef< RectRaw > dstrect, ScaleMode scaleMode)
 Perform a stretched pixel copy from one surface to another. More...
 
void SDL::Surface::BlitTiled (SurfaceParam src, OptionalRef< const RectRaw > srcrect, OptionalRef< const RectRaw > dstrect)
 Perform a tiled blit to a destination surface, which may be of a different format. More...
 
void SDL::Surface::BlitTiledWithScale (SurfaceParam src, OptionalRef< const RectRaw > srcrect, float scale, SDL_ScaleMode scaleMode, OptionalRef< const RectRaw > dstrect)
 Perform a scaled and tiled blit to a destination surface, which may be of a different format. More...
 
void SDL::Surface::Blit9Grid (SurfaceParam src, OptionalRef< const RectRaw > srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, OptionalRef< const RectRaw > dstrect)
 Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format. More...
 
Uint32 SDL::Surface::MapRGB (Uint8 r, Uint8 g, Uint8 b) const
 Map an RGB triple to an opaque pixel value for a surface. More...
 
Uint32 SDL::Surface::MapRGBA (ColorRaw c) const
 Map an RGBA quadruple to a pixel value for a surface. More...
 
void SDL::Surface::ReadPixel (const PointRaw &p, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) const
 Retrieves a single pixel from a surface. More...
 
void SDL::Surface::ReadPixelFloat (const PointRaw &p, float *r, float *g, float *b, float *a) const
 Retrieves a single pixel from a surface. More...
 
void SDL::Surface::WritePixel (const PointRaw &p, ColorRaw c)
 Writes a single pixel to a surface. More...
 
void SDL::Surface::WritePixelFloat (const PointRaw &p, const FColorRaw &c)
 Writes a single pixel to a surface. More...
 

Variables

constexpr SurfaceFlags SDL::SURFACE_PREALLOCATED
 Surface uses preallocated pixel memory. More...
 
constexpr SurfaceFlags SDL::SURFACE_LOCK_NEEDED
 Surface needs to be locked to access pixels. More...
 
constexpr SurfaceFlags SDL::SURFACE_LOCKED
 Surface is currently locked. More...
 
constexpr SurfaceFlags SDL::SURFACE_SIMD_ALIGNED = SDL_SURFACE_SIMD_ALIGNED
 Surface uses pixel memory allocated with aligned_alloc()
 
constexpr ScaleMode SDL::SCALEMODE_INVALID = SDL_SCALEMODE_INVALID
 INVALID.
 
constexpr ScaleMode SDL::SCALEMODE_NEAREST
 nearest pixel sampling More...
 
constexpr ScaleMode SDL::SCALEMODE_LINEAR
 linear filtering More...
 
constexpr FlipMode SDL::FLIP_NONE = SDL_FLIP_NONE
 Do not flip.
 
constexpr FlipMode SDL::FLIP_HORIZONTAL = SDL_FLIP_HORIZONTAL
 flip horizontally
 
constexpr FlipMode SDL::FLIP_VERTICAL = SDL_FLIP_VERTICAL
 flip vertically
 

Detailed Description

These are useful for passing around and manipulating images that are not stored in GPU memory.

Surface makes serious efforts to manage images in various formats, and provides a reasonable toolbox for transforming the data, including copying between surfaces, filling rectangles in the image data, etc.

There is also a simple .bmp loader, Surface.LoadBMP(). SDL itself does not provide loaders for various other file formats, but there are several excellent external libraries that do, including its own satellite library, SDL_image:

https://github.com/libsdl-org/SDL_image

Typedef Documentation

◆ FlipMode

using SDL::FlipMode = typedef SDL_FlipMode
Since
This enum is available since SDL 3.2.0.

◆ ScaleMode

using SDL::ScaleMode = typedef SDL_ScaleMode
Since
This enum is available since SDL 3.2.0.

◆ SurfaceFlags

using SDL::SurfaceFlags = typedef Uint32

These are generally considered read-only.

Since
This datatype is available since SDL 3.2.0.

Function Documentation

◆ AddAlternateImage()

void SDL::Surface::AddAlternateImage ( SurfaceParam  image)
inline

This function adds an alternate version of this surface, usually used for content with high DPI representations like cursors or icons. The size, format, and content do not need to match the original surface, and these alternate versions will not be updated when the original surface changes.

This function adds a reference to the alternate version, so you should call Surface.Destroy() on the image after this call.

Parameters
imagean alternate Surface to associate with this surface.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.RemoveAlternateImages
Surface.GetImages
Surface.HasAlternateImages

◆ AddSurfaceAlternateImage()

void SDL::AddSurfaceAlternateImage ( SurfaceParam  surface,
SurfaceParam  image 
)
inline

This function adds an alternate version of this surface, usually used for content with high DPI representations like cursors or icons. The size, format, and content do not need to match the original surface, and these alternate versions will not be updated when the original surface changes.

This function adds a reference to the alternate version, so you should call Surface.Destroy() on the image after this call.

Parameters
surfacethe Surface structure to update.
imagea pointer to an alternate Surface to associate with this surface.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.RemoveAlternateImages
Surface.GetImages
Surface.HasAlternateImages

◆ Blit()

void SDL::Surface::Blit ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
OptionalRef< const RectRaw dstrect 
)
inline

If either srcrect or dstrect are nullptr, the entire surface (src or dst) is copied while ensuring clipping to dst->clip_rect.

The blit function should not be called on a locked surface.

The blit semantics for surfaces with and without blending and colorkey are defined as follows:

RGBA->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
RGBA->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
constexpr BlendMode BLENDMODE_NONE
no blending: dstRGBA = srcRGBA
Definition: SDL3pp_blendmode.h:37
constexpr BlendMode BLENDMODE_BLEND
alpha blending: dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)), dstA = srcA + (dstA * (1-srcA))
Definition: SDL3pp_blendmode.h:44
Parameters
srcthe SurfaceRaw structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstrectthe Rect structure representing the x and y position in the destination surface, or nullptr for (0,0). The width and height are ignored, and are copied from srcrect. If you want a specific width and height, you should use Surface.BlitScaled().
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.BlitScaled

◆ Blit9Grid()

void SDL::Surface::Blit9Grid ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
int  left_width,
int  right_width,
int  top_height,
int  bottom_height,
float  scale,
SDL_ScaleMode  scaleMode,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in the source surface are split into a 3x3 grid, using the different corner sizes for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using scale and fit into the corners of the destination rectangle. The sides and center are then stretched into place to cover the remaining destination rectangle.

Parameters
srcthe SDL_Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be used for the 9-grid, or nullptr to use the entire surface.
left_widththe width, in pixels, of the left corners in srcrect.
right_widththe width, in pixels, of the right corners in srcrect.
top_heightthe height, in pixels, of the top corners in srcrect.
bottom_heightthe height, in pixels, of the bottom corners in srcrect.
scalethe scale used to transform the corner of srcrect into the corner of dstrect, or 0.0f for an unscaled blit.
scaleModescale algorithm to be used.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitScaled()

void SDL::Surface::BlitScaled ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
OptionalRef< const RectRaw dstrect,
ScaleMode  scaleMode 
)
inline
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire destination surface.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurface()

void SDL::BlitSurface ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect 
)
inline

If either srcrect or dstrect are nullptr, the entire surface (src or dst) is copied while ensuring clipping to dst->clip_rect.

The blit function should not be called on a locked surface.

The blit semantics for surfaces with and without blending and colorkey are defined as follows:

RGBA->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
RGBA->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the x and y position in the destination surface, or nullptr for (0,0). The width and height are ignored, and are copied from srcrect. If you want a specific width and height, you should use Surface.BlitScaled().
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.BlitScaled

◆ BlitSurface9Grid() [1/2]

void SDL::BlitSurface9Grid ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
int  left_width,
int  right_width,
int  top_height,
int  bottom_height,
float  scale,
SDL_ScaleMode  scaleMode,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in the source surface are split into a 3x3 grid, using the different corner sizes for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using scale and fit into the corners of the destination rectangle. The sides and center are then stretched into place to cover the remaining destination rectangle.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be used for the 9-grid, or nullptr to use the entire surface.
left_widththe width, in pixels, of the left corners in srcrect.
right_widththe width, in pixels, of the right corners in srcrect.
top_heightthe height, in pixels, of the top corners in srcrect.
bottom_heightthe height, in pixels, of the bottom corners in srcrect.
scalethe scale used to transform the corner of srcrect into the corner of dstrect, or 0.0f for an unscaled blit.
scaleModescale algorithm to be used.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurface9Grid() [2/2]

void SDL::BlitSurface9Grid ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
int  left_width,
int  right_width,
int  top_height,
int  bottom_height,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in the source surface are split into a 3x3 grid, using the different corner sizes for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using scale and fit into the corners of the destination rectangle. The sides and center are then stretched into place to cover the remaining destination rectangle.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be used for the 9-grid, or nullptr to use the entire surface.
left_widththe width, in pixels, of the left corners in srcrect.
right_widththe width, in pixels, of the right corners in srcrect.
top_heightthe height, in pixels, of the top corners in srcrect.
bottom_heightthe height, in pixels, of the bottom corners in srcrect.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurfaceAt()

void SDL::BlitSurfaceAt ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
SurfaceParam  dst,
const PointRaw dstpos 
)
inline

If either srcrect or dstrect are nullptr, the entire surface (src or dst) is copied while ensuring clipping to dst->clip_rect.

The blit function should not be called on a locked surface.

The blit semantics for surfaces with and without blending and colorkey are defined as follows:

RGBA->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
RGBA->RGBA:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to BLENDMODE_NONE:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGB:
Source surface blend mode set to BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to BLENDMODE_NONE:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels that do not match the
source color key.
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstthe Surface structure that is the blit target.
dstposthe Point structure representing the x and y position in the destination surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.BlitSurface

◆ BlitSurfaceScaled()

void SDL::BlitSurfaceScaled ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect,
ScaleMode  scaleMode 
)
inline
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire destination surface.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurfaceTiled()

void SDL::BlitSurfaceTiled ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in srcrect will be repeated as many times as needed to completely fill dstrect.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurfaceTiledWithScale()

void SDL::BlitSurfaceTiledWithScale ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
float  scale,
SDL_ScaleMode  scaleMode,
SurfaceParam  dst,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in srcrect will be scaled and repeated as many times as needed to completely fill dstrect.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
scalethe scale used to transform srcrect into the destination rectangle, e.g. a 32x32 texture with a scale of 2 would fill 64x64 tiles.
scaleModescale algorithm to be used.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurfaceUnchecked()

void SDL::BlitSurfaceUnchecked ( SurfaceParam  src,
const RectRaw srcrect,
SurfaceParam  dst,
const RectRaw dstrect 
)
inline

This is a semi-private blit function and it performs low-level surface blitting, assuming the input rectangles have already been clipped.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, may not be nullptr.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, may not be nullptr.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitSurfaceUncheckedScaled()

void SDL::BlitSurfaceUncheckedScaled ( SurfaceParam  src,
const RectRaw srcrect,
SurfaceParam  dst,
const RectRaw dstrect,
ScaleMode  scaleMode 
)
inline

This is a semi-private function and it performs low-level surface blitting, assuming the input rectangles have already been clipped.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, may not be nullptr.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, may not be nullptr.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.BlitScaled

◆ BlitTiled()

void SDL::Surface::BlitTiled ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in srcrect will be repeated as many times as needed to completely fill dstrect.

Parameters
srcthe SDL_Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitTiledWithScale()

void SDL::Surface::BlitTiledWithScale ( SurfaceParam  src,
OptionalRef< const RectRaw srcrect,
float  scale,
SDL_ScaleMode  scaleMode,
OptionalRef< const RectRaw dstrect 
)
inline

The pixels in srcrect will be scaled and repeated as many times as needed to completely fill dstrect.

Parameters
srcthe SDL_Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
scalethe scale used to transform srcrect into the destination rectangle, e.g. a 32x32 texture with a scale of 2 would fill 64x64 tiles.
scaleModescale algorithm to be used.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire surface.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitUnchecked()

void SDL::Surface::BlitUnchecked ( SurfaceParam  src,
const RectRaw srcrect,
const RectRaw dstrect 
)
inline

This is a semi-private blit function and it performs low-level surface blitting, assuming the input rectangles have already been clipped.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, may not be nullptr.
dstrectthe Rect structure representing the target rectangle in the destination surface, may not be nullptr.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit

◆ BlitUncheckedScaled()

void SDL::Surface::BlitUncheckedScaled ( SurfaceParam  src,
const RectRaw srcrect,
const RectRaw dstrect,
ScaleMode  scaleMode 
)
inline

This is a semi-private function and it performs low-level surface blitting, assuming the input rectangles have already been clipped.

Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, may not be nullptr.
dstrectthe Rect structure representing the target rectangle in the destination surface, may not be nullptr.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.2.0.
See also
Surface.BlitScaled

◆ Clear()

void SDL::Surface::Clear ( const FColorRaw color)
inline

This function handles all surface formats, and ignores any clip rectangle.

If the surface is YUV, the color is assumed to be in the sRGB colorspace, otherwise the color is assumed to be in the colorspace of the surface.

Parameters
colorthe color components of the pixel, normally in the range 0-1.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ ClearSurface()

void SDL::ClearSurface ( SurfaceParam  surface,
const FColorRaw color 
)
inline

This function handles all surface formats, and ignores any clip rectangle.

If the surface is YUV, the color is assumed to be in the sRGB colorspace, otherwise the color is assumed to be in the colorspace of the suface.

Parameters
surfacethe Surface to clear.
colorthe color components of the pixel, normally in the range 0-1.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ Convert() [1/2]

Surface SDL::Surface::Convert ( PixelFormat  format) const
inline

This function is used to optimize images for faster repeat blitting. This is accomplished by converting the original and storing the result as a new surface. The new, optimized surface can then be used as the source for future blits, making them faster.

If you are converting to an indexed surface and want to map colors to a palette, you can use Surface.Convert() instead.

If the original surface has alternate images, the new surface will have a reference to them as well.

Parameters
formatthe new pixel format.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Convert
Surface.Destroy

◆ Convert() [2/2]

Surface SDL::Surface::Convert ( PixelFormat  format,
PaletteParam  palette,
Colorspace  colorspace,
PropertiesParam  props 
) const
inline

This function converts an existing surface to a new format and colorspace and returns the new surface. This will perform any pixel format and colorspace conversion needed.

If the original surface has alternate images, the new surface will have a reference to them as well.

Parameters
formatthe new pixel format.
palettean optional palette to use for indexed formats, may be nullptr.
colorspacethe new colorspace.
propsan Properties with additional color properties, or 0.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Convert
Surface.Destroy

◆ ConvertPixels()

void SDL::ConvertPixels ( const PointRaw size,
PixelFormat  src_format,
const void *  src,
int  src_pitch,
PixelFormat  dst_format,
void *  dst,
int  dst_pitch 
)
inline
Parameters
sizethe width and height of the surface.
src_formatan PixelFormat value of the src pixels format.
srca pointer to the source pixels.
src_pitchthe pitch of the source pixels, in bytes.
dst_formatan PixelFormat value of the dst pixels format.
dsta pointer to be filled in with new pixel data.
dst_pitchthe pitch of the destination pixels, in bytes.
Exceptions
Erroron failure.
Thread safety:
The same destination pixels should not be used from two threads at once. It is safe to use the same source pixels from multiple threads.
Since
This function is available since SDL 3.2.0.
See also
ConvertPixelsAndColorspace

◆ ConvertPixelsAndColorspace()

void SDL::ConvertPixelsAndColorspace ( const PointRaw size,
PixelFormat  src_format,
Colorspace  src_colorspace,
PropertiesParam  src_properties,
const void *  src,
int  src_pitch,
PixelFormat  dst_format,
Colorspace  dst_colorspace,
PropertiesParam  dst_properties,
void *  dst,
int  dst_pitch 
)
inline
Parameters
sizethe width and height of the block to copy, in pixels.
src_formatan PixelFormat value of the src pixels format.
src_colorspacean Colorspace value describing the colorspace of the src pixels.
src_propertiesan Properties with additional source color properties, or 0.
srca pointer to the source pixels.
src_pitchthe pitch of the source pixels, in bytes.
dst_formatan PixelFormat value of the dst pixels format.
dst_colorspacean Colorspace value describing the colorspace of the dst pixels.
dst_propertiesan Properties with additional destination color properties, or 0.
dsta pointer to be filled in with new pixel data.
dst_pitchthe pitch of the destination pixels, in bytes.
Exceptions
Erroron failure.
Thread safety:
The same destination pixels should not be used from two threads at once. It is safe to use the same source pixels from multiple threads.
Since
This function is available since SDL 3.2.0.
See also
ConvertPixels

◆ ConvertSurface()

Surface SDL::ConvertSurface ( SurfaceConstParam  surface,
PixelFormat  format 
)
inline

This function is used to optimize images for faster repeat blitting. This is accomplished by converting the original and storing the result as a new surface. The new, optimized surface can then be used as the source for future blits, making them faster.

If you are converting to an indexed surface and want to map colors to a palette, you can use Surface.Convert() instead.

If the original surface has alternate images, the new surface will have a reference to them as well.

Parameters
surfacethe existing Surface structure to convert.
formatthe new pixel format.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Convert
Surface.Destroy

◆ ConvertSurfaceAndColorspace()

Surface SDL::ConvertSurfaceAndColorspace ( SurfaceConstParam  surface,
PixelFormat  format,
PaletteParam  palette,
Colorspace  colorspace,
PropertiesParam  props 
)
inline

This function converts an existing surface to a new format and colorspace and returns the new surface. This will perform any pixel format and colorspace conversion needed.

If the original surface has alternate images, the new surface will have a reference to them as well.

Parameters
surfacethe existing Surface structure to convert.
formatthe new pixel format.
palettean optional palette to use for indexed formats, may be nullptr.
colorspacethe new colorspace.
propsan Properties with additional color properties, or 0.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Convert
Surface.Destroy

◆ CreatePalette()

Palette SDL::Surface::CreatePalette ( )
inline

This function creates a palette compatible with the provided surface. The palette is then returned for you to modify, and the surface will automatically use the new palette in future operations. You do not need to destroy the returned palette, it will be freed when the reference count reaches 0, usually when the surface is destroyed.

Bitmap surfaces (with format PIXELFORMAT_INDEX1LSB or PIXELFORMAT_INDEX1MSB) will have the palette initialized with 0 as white and 1 as black. Other surfaces will get a palette initialized with white in every entry.

If this function is called for a surface that already has a palette, a new palette will be created to replace it.

Returns
a new Palette structure on success.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Palette.SetColors

◆ CreateSurface()

Surface SDL::CreateSurface ( const PointRaw size,
PixelFormat  format 
)
inline

The pixels of the new surface are initialized to zero.

Parameters
sizethe width and height of the surface.
formatthe PixelFormat for the new surface's pixel format.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Surface
Surface.Destroy

◆ CreateSurfaceFrom()

Surface SDL::CreateSurfaceFrom ( const PointRaw size,
PixelFormat  format,
void *  pixels,
int  pitch 
)
inline

No copy is made of the pixel data. Pixel data is not managed automatically; you must free the surface before you free the pixel data.

Pitch is the offset in bytes from one row of pixels to the next, e.g. width*4 for PIXELFORMAT_RGBA8888.

You may pass nullptr for pixels and 0 for pitch to create a surface that you will fill in with valid values later.

Parameters
sizethe width and height of the surface.
formatthe PixelFormat for the new surface's pixel format.
pixelsa pointer to existing pixel data.
pitchthe number of bytes between each row, including padding.
Returns
the new Surface structure that is created or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Surface
Surface.Destroy

◆ CreateSurfacePalette()

Palette SDL::CreateSurfacePalette ( SurfaceParam  surface)
inline

This function creates a palette compatible with the provided surface. The palette is then returned for you to modify, and the surface will automatically use the new palette in future operations. You do not need to destroy the returned palette, it will be freed when the reference count reaches 0, usually when the surface is destroyed.

Bitmap surfaces (with format PIXELFORMAT_INDEX1LSB or PIXELFORMAT_INDEX1MSB) will have the palette initialized with 0 as white and 1 as black. Other surfaces will get a palette initialized with white in every entry.

If this function is called for a surface that already has a palette, a new palette will be created to replace it.

Parameters
surfacethe Surface structure to update.
Returns
a new Palette structure on success.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Palette.SetColors

◆ Destroy()

void SDL::Surface::Destroy ( )
inline

It is safe to pass nullptr to this function.

Thread safety:
No other thread should be using the surface when it is freed.
Since
This function is available since SDL 3.2.0.
See also
Surface.Surface
Surface.Surface

◆ DestroySurface()

void SDL::DestroySurface ( SurfaceRaw  surface)
inline

It is safe to pass nullptr to this function.

Parameters
surfacethe Surface to free.
Thread safety:
No other thread should be using the surface when it is freed.
Since
This function is available since SDL 3.2.0.
See also
Surface.Surface
Surface.Surface

◆ Duplicate()

Surface SDL::Surface::Duplicate ( ) const
inline

If the original surface has alternate images, the new surface will have a reference to them as well.

Returns
a copy of the surface or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy

◆ DuplicateSurface()

Surface SDL::DuplicateSurface ( SurfaceConstParam  surface)
inline

If the original surface has alternate images, the new surface will have a reference to them as well.

The returned surface should be freed with Surface.Destroy().

Parameters
surfacethe surface to duplicate.
Returns
a copy of the surface or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy

◆ FillRect()

void SDL::Surface::FillRect ( OptionalRef< const RectRaw rect,
Uint32  color 
)
inline

color should be a pixel of the format used by the surface, and can be generated by MapRGB() or MapRGBA(). If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place.

If there is a clip rectangle set on the destination (set via Surface.SetClipRect()), then this function will fill based on the intersection of the clip rectangle and rect.

Parameters
rectthe Rect structure representing the rectangle to fill, or nullptr to fill the entire surface.
colorthe color to fill with.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.FillRects

◆ FillRects()

void SDL::Surface::FillRects ( SpanRef< const RectRaw rects,
Uint32  color 
)
inline

color should be a pixel of the format used by the surface, and can be generated by MapRGB() or MapRGBA(). If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place.

If there is a clip rectangle set on the destination (set via Surface.SetClipRect()), then this function will fill based on the intersection of the clip rectangle and rect.

Parameters
rectsan array of SDL_Rects representing the rectangles to fill.
colorthe color to fill with.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.FillRect

◆ FillSurfaceRect()

void SDL::FillSurfaceRect ( SurfaceParam  dst,
OptionalRef< const RectRaw rect,
Uint32  color 
)
inline

color should be a pixel of the format used by the surface, and can be generated by MapRGB() or MapRGBA(). If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place.

If there is a clip rectangle set on the destination (set via Surface.SetClipRect()), then this function will fill based on the intersection of the clip rectangle and rect.

Parameters
dstthe Surface structure that is the drawing target.
rectthe Rect structure representing the rectangle to fill, or nullptr to fill the entire surface.
colorthe color to fill with.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.FillRects

◆ FillSurfaceRects()

void SDL::FillSurfaceRects ( SurfaceParam  dst,
SpanRef< const RectRaw rects,
Uint32  color 
)
inline

color should be a pixel of the format used by the surface, and can be generated by MapRGB() or MapRGBA(). If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place.

If there is a clip rectangle set on the destination (set via Surface.SetClipRect()), then this function will fill based on the intersection of the clip rectangle and rect.

Parameters
dstthe Surface structure that is the drawing target.
rectsan array of SDL_Rects representing the rectangles to fill.
colorthe color to fill with.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.FillRect

◆ Flip()

void SDL::Surface::Flip ( FlipMode  flip)
inline
Parameters
flipthe direction to flip.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ FlipSurface()

void SDL::FlipSurface ( SurfaceParam  surface,
FlipMode  flip 
)
inline
Parameters
surfacethe surface to flip.
flipthe direction to flip.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ GetAlphaMod()

Uint8 SDL::Surface::GetAlphaMod ( ) const
inline
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorMod
Surface.SetAlphaMod

◆ GetBlendMode()

BlendMode SDL::Surface::GetBlendMode ( ) const
inline
Returns
the current BlendMode.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetBlendMode

◆ GetClipRect()

Rect SDL::Surface::GetClipRect ( ) const
inline

When surface is the destination of a blit, only the area within the clip rectangle is drawn into.

Returns
the Rect structure filled in with the clipping rectangle for the surface on success.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetClipRect

◆ GetColorKey()

std::optional< Uint32 > SDL::Surface::GetColorKey ( ) const
inline

The color key is a pixel of the format used by the surface, as generated by MapRGB().

If the surface doesn't have color key enabled this function returns false.

Returns
the transparent pixel or nullopt if none.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorKey
Surface.HasColorKey

◆ GetColorMod()

void SDL::Surface::GetColorMod ( Uint8 r,
Uint8 g,
Uint8 b 
) const
inline
Parameters
ra pointer filled in with the current red color value.
ga pointer filled in with the current green color value.
ba pointer filled in with the current blue color value.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetAlphaMod
Surface.SetColorMod

◆ GetColorspace()

Colorspace SDL::Surface::GetColorspace ( ) const
inline

The colorspace defaults to COLORSPACE_SRGB_LINEAR for floating point formats, COLORSPACE_HDR10 for 10-bit formats, COLORSPACE_SRGB for other RGB surfaces and COLORSPACE_BT709_FULL for YUV textures.

Returns
the colorspace used by the surface, or COLORSPACE_UNKNOWN if the surface is nullptr.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorspace

◆ GetImages()

OwnArray< SurfaceRaw > SDL::Surface::GetImages ( ) const
inline

This returns all versions of a surface, with the surface being queried as the first element in the returned array.

Returns
a nullptr terminated array of Surface pointers or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.RemoveAlternateImages
Surface.HasAlternateImages

◆ GetPalette()

Palette SDL::Surface::GetPalette ( ) const
inline
Returns
a pointer to the palette used by the surface, or nullptr if there is no palette used.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetPalette

◆ GetProperties()

PropertiesRef SDL::Surface::GetProperties ( ) const
inline

The following properties are understood by SDL:

  • prop::Surface.SDR_WHITE_POINT_FLOAT: for HDR10 and floating point surfaces, this defines the value of 100% diffuse white, with higher values being displayed in the High Dynamic Range headroom. This defaults to 203 for HDR10 surfaces and 1.0 for floating point surfaces.
  • prop::Surface.HDR_HEADROOM_FLOAT: for HDR10 and floating point surfaces, this defines the maximum dynamic range used by the content, in terms of the SDR white point. This defaults to 0.0, which disables tone mapping.
  • prop::Surface.TONEMAP_OPERATOR_STRING: the tone mapping operator used when compressing from a surface with high dynamic range to another with lower dynamic range. Currently this supports "chrome", which uses the same tone mapping that Chrome uses for HDR content, the form "*=N", where N is a floating point scale factor applied in linear space, and "none", which disables tone mapping. This defaults to "chrome".
  • prop::Surface.HOTSPOT_X_NUMBER: the hotspot pixel offset from the left edge of the image, if this surface is being used as a cursor.
  • prop::Surface.HOTSPOT_Y_NUMBER: the hotspot pixel offset from the top edge of the image, if this surface is being used as a cursor.
Returns
a valid property ID on success.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ GetSurfaceAlphaMod()

Uint8 SDL::GetSurfaceAlphaMod ( SurfaceConstParam  surface)
inline
Parameters
surfacethe Surface structure to query.
Returns
the current alpha value.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorMod
Surface.SetAlphaMod

◆ GetSurfaceBlendMode()

BlendMode SDL::GetSurfaceBlendMode ( SurfaceConstParam  surface)
inline
Parameters
surfacethe Surface structure to query.
Returns
the current BlendMode.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetBlendMode

◆ GetSurfaceClipRect()

Rect SDL::GetSurfaceClipRect ( SurfaceConstParam  surface)
inline

When surface is the destination of a blit, only the area within the clip rectangle is drawn into.

Parameters
surfacethe Surface structure representing the surface to be clipped.
Returns
the Rect structure filled in with the clipping rectangle for the surface.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetClipRect

◆ GetSurfaceColorKey()

std::optional< Uint32 > SDL::GetSurfaceColorKey ( SurfaceConstParam  surface)
inline

The color key is a pixel of the format used by the surface, as generated by MapRGB().

If the surface doesn't have color key enabled this function returns false.

Parameters
surfacethe Surface structure to query.
Returns
the transparent pixel or nullopt if none.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorKey
Surface.HasColorKey

◆ GetSurfaceColorMod()

void SDL::GetSurfaceColorMod ( SurfaceConstParam  surface,
Uint8 r,
Uint8 g,
Uint8 b 
)
inline
Parameters
surfacethe Surface structure to query.
ra pointer filled in with the current red color value.
ga pointer filled in with the current green color value.
ba pointer filled in with the current blue color value.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetAlphaMod
Surface.SetColorMod

◆ GetSurfaceColorspace()

Colorspace SDL::GetSurfaceColorspace ( SurfaceConstParam  surface)
inline

The colorspace defaults to COLORSPACE_SRGB_LINEAR for floating point formats, COLORSPACE_HDR10 for 10-bit formats, COLORSPACE_SRGB for other RGB surfaces and COLORSPACE_BT709_FULL for YUV textures.

Parameters
surfacethe Surface structure to query.
Returns
the colorspace used by the surface, or COLORSPACE_UNKNOWN if the surface is nullptr.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorspace

◆ GetSurfaceImages()

OwnArray< SurfaceRaw > SDL::GetSurfaceImages ( SurfaceConstParam  surface)
inline

This returns all versions of a surface, with the surface being queried as the first element in the returned array.

Freeing the array of surfaces does not affect the surfaces in the array. They are still referenced by the surface being queried and will be cleaned up normally.

Parameters
surfacethe Surface structure to query.
Returns
a nullptr terminated array of Surface pointers or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.RemoveAlternateImages
Surface.HasAlternateImages

◆ GetSurfacePalette()

Palette SDL::GetSurfacePalette ( SurfaceConstParam  surface)
inline
Parameters
surfacethe Surface structure to query.
Returns
a pointer to the palette used by the surface, or nullptr if there is no palette used.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetPalette

◆ GetSurfaceProperties()

PropertiesRef SDL::GetSurfaceProperties ( SurfaceConstParam  surface)
inline

The following properties are understood by SDL:

  • prop::Surface.SDR_WHITE_POINT_FLOAT: for HDR10 and floating point surfaces, this defines the value of 100% diffuse white, with higher values being displayed in the High Dynamic Range headroom. This defaults to 203 for HDR10 surfaces and 1.0 for floating point surfaces.
  • prop::Surface.HDR_HEADROOM_FLOAT: for HDR10 and floating point surfaces, this defines the maximum dynamic range used by the content, in terms of the SDR white point. This defaults to 0.0, which disables tone mapping.
  • prop::Surface.TONEMAP_OPERATOR_STRING: the tone mapping operator used when compressing from a surface with high dynamic range to another with lower dynamic range. Currently this supports "chrome", which uses the same tone mapping that Chrome uses for HDR content, the form "*=N", where N is a floating point scale factor applied in linear space, and "none", which disables tone mapping. This defaults to "chrome".
  • prop::Surface.HOTSPOT_X_NUMBER: the hotspot pixel offset from the left edge of the image, if this surface is being used as a cursor.
  • prop::Surface.HOTSPOT_Y_NUMBER: the hotspot pixel offset from the top edge of the image, if this surface is being used as a cursor.
Parameters
surfacethe Surface structure to query.
Returns
a valid property ID on success.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

◆ HasAlternateImages()

bool SDL::Surface::HasAlternateImages ( ) const
inline
Returns
true if alternate versions are available or false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.RemoveAlternateImages
Surface.GetImages

◆ HasColorKey()

bool SDL::Surface::HasColorKey ( ) const
inline
Returns
true if the surface has a color key, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorKey
Surface.GetColorKey

◆ HasRLE()

bool SDL::Surface::HasRLE ( ) const
inline

It is safe to pass a nullptr surface here; it will return false.

Returns
true if the surface is RLE enabled, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetRLE

◆ LoadBMP() [1/4]

Surface SDL::Surface::LoadBMP ( IOStreamParam  src,
bool  closeio = false 
)
inlinestatic

The new surface should be freed with Surface.Destroy(). Not doing so will result in a memory leak.

Parameters
srcthe data stream for the surface.
closeioif true, calls IOStream.Close() on src before returning, even in the case of an error.
Returns
a pointer to a new Surface structure or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy
Surface.LoadBMP
Surface.SaveBMP

◆ LoadBMP() [2/4]

Surface SDL::LoadBMP ( IOStreamParam  src,
bool  closeio = false 
)
inline

The new surface should be freed with Surface.Destroy(). Not doing so will result in a memory leak.

Parameters
srcthe data stream for the surface.
closeioif true, calls IOStream.Close() on src before returning, even in the case of an error.
Returns
a pointer to a new Surface structure or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy
Surface.LoadBMP
Surface.SaveBMP

◆ LoadBMP() [3/4]

Surface SDL::Surface::LoadBMP ( StringParam  file)
inlinestatic

The new surface should be freed with Surface.Destroy(). Not doing so will result in a memory leak.

Parameters
filethe BMP file to load.
Returns
a pointer to a new Surface structure or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy
Surface.LoadBMP
Surface.SaveBMP

◆ LoadBMP() [4/4]

Surface SDL::LoadBMP ( StringParam  file)
inline

The new surface should be freed with Surface.Destroy(). Not doing so will result in a memory leak.

Parameters
filethe BMP file to load.
Returns
a pointer to a new Surface structure or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy
Surface.LoadBMP
Surface.SaveBMP

◆ Lock()

void SDL::Surface::Lock ( )
inline

Between calls to Surface.Lock() / Surface.Unlock(), you can write to and read from surface->pixels, using the pixel format stored in surface->format. Once you are done accessing the surface, you should use Surface.Unlock() to release it.

Not all surfaces require locking. If Surface.MustLock() evaluates to false, then you can read and write to the surface at any time, and the pixel format of the surface will not change.

Exceptions
Erroron failure.
Thread safety:
This function is not thread safe. The locking referred to by this function is making the pixels available for direct access, not thread-safe locking.
Since
This function is available since SDL 3.2.0.
See also
Surface.MustLock
Surface.Unlock

◆ LockSurface()

void SDL::LockSurface ( SurfaceParam  surface)
inline

Between calls to Surface.Lock() / Surface.Unlock(), you can write to and read from surface->pixels, using the pixel format stored in surface->format. Once you are done accessing the surface, you should use Surface.Unlock() to release it.

Not all surfaces require locking. If Surface.MustLock() evaluates to 0, then you can read and write to the surface at any time, and the pixel format of the surface will not change.

Parameters
surfacethe Surface structure to be locked.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe. The locking referred to by this function is making the pixels available for direct access, not thread-safe locking.
Since
This function is available since SDL 3.2.0.
See also
Surface.MustLock
Surface.Unlock

◆ MapRGB()

Uint32 SDL::Surface::MapRGB ( Uint8  r,
Uint8  g,
Uint8  b 
) const
inline

This function maps the RGB color value to the specified pixel format and returns the pixel value best approximating the given RGB color value for the given pixel format.

If the surface has a palette, the index of the closest matching color in the palette will be returned.

If the surface pixel format has an alpha component it will be returned as all 1 bits (fully opaque).

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
rthe red component of the pixel in the range 0-255.
gthe green component of the pixel in the range 0-255.
bthe blue component of the pixel in the range 0-255.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.MapRGBA

◆ MapRGBA()

Uint32 SDL::Surface::MapRGBA ( ColorRaw  c) const
inline

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the surface pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the surface has a palette, the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
cthe color components of the pixel in the range 0-255.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.MapRGB

◆ MapSurfaceRGB()

Uint32 SDL::MapSurfaceRGB ( SurfaceConstParam  surface,
Uint8  r,
Uint8  g,
Uint8  b 
)
inline

This function maps the RGB color value to the specified pixel format and returns the pixel value best approximating the given RGB color value for the given pixel format.

If the surface has a palette, the index of the closest matching color in the palette will be returned.

If the surface pixel format has an alpha component it will be returned as all 1 bits (fully opaque).

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
surfacethe surface to use for the pixel format and palette.
rthe red component of the pixel in the range 0-255.
gthe green component of the pixel in the range 0-255.
bthe blue component of the pixel in the range 0-255.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.MapRGBA

◆ MapSurfaceRGBA()

Uint32 SDL::MapSurfaceRGBA ( SurfaceConstParam  surface,
ColorRaw  c 
)
inline

This function maps the RGBA color value to the specified pixel format and returns the pixel value best approximating the given RGBA color value for the given pixel format.

If the surface pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

If the surface has a palette, the index of the closest matching color in the palette will be returned.

If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

Parameters
surfacethe surface to use for the pixel format and palette.
cthe color components of the pixel in the range 0-255.
Returns
a pixel value.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.MapRGB

◆ MUSTLOCK()

constexpr bool SDL::MUSTLOCK ( SurfaceConstParam  S)
constexpr
Since
This macro is available since SDL 3.2.0.

◆ PremultiplyAlpha() [1/2]

void SDL::Surface::PremultiplyAlpha ( bool  linear)
inline

This is safe to use with src == dst, but not for other overlapping areas.

Parameters
lineartrue to convert from sRGB to linear space for the alpha multiplication, false to do multiplication in sRGB space.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ PremultiplyAlpha() [2/2]

void SDL::PremultiplyAlpha ( const PointRaw size,
PixelFormat  src_format,
const void *  src,
int  src_pitch,
PixelFormat  dst_format,
void *  dst,
int  dst_pitch,
bool  linear 
)
inline

This is safe to use with src == dst, but not for other overlapping areas.

Parameters
sizethe width and height of the surface.
src_formatan PixelFormat value of the src pixels format.
srca pointer to the source pixels.
src_pitchthe pitch of the source pixels, in bytes.
dst_formatan PixelFormat value of the dst pixels format.
dsta pointer to be filled in with premultiplied pixel data.
dst_pitchthe pitch of the destination pixels, in bytes.
lineartrue to convert from sRGB to linear space for the alpha multiplication, false to do multiplication in sRGB space.
Exceptions
Erroron failure.
Thread safety:
The same destination pixels should not be used from two threads at once. It is safe to use the same source pixels from multiple threads.
Since
This function is available since SDL 3.2.0.

◆ PremultiplySurfaceAlpha()

void SDL::PremultiplySurfaceAlpha ( SurfaceParam  surface,
bool  linear 
)
inline

This is safe to use with src == dst, but not for other overlapping areas.

Parameters
surfacethe surface to modify.
lineartrue to convert from sRGB to linear space for the alpha multiplication, false to do multiplication in sRGB space.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ ReadPixel()

void SDL::Surface::ReadPixel ( const PointRaw p,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
) const
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Like GetRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.

Parameters
pthe coordinates, 0 <= x < width and 0 <= y < height.
ra pointer filled in with the red channel, 0-255, or nullptr to ignore this channel.
ga pointer filled in with the green channel, 0-255, or nullptr to ignore this channel.
ba pointer filled in with the blue channel, 0-255, or nullptr to ignore this channel.
aa pointer filled in with the alpha channel, 0-255, or nullptr to ignore this channel.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ ReadPixelFloat()

void SDL::Surface::ReadPixelFloat ( const PointRaw p,
float *  r,
float *  g,
float *  b,
float *  a 
) const
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Parameters
pthe coordinates, 0 <= x < width and 0 <= y < height.
ra pointer filled in with the red channel, normally in the range 0-1, or nullptr to ignore this channel.
ga pointer filled in with the green channel, normally in the range 0-1, or nullptr to ignore this channel.
ba pointer filled in with the blue channel, normally in the range 0-1, or nullptr to ignore this channel.
aa pointer filled in with the alpha channel, normally in the range 0-1, or nullptr to ignore this channel.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ ReadSurfacePixel()

void SDL::ReadSurfacePixel ( SurfaceConstParam  surface,
const PointRaw p,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Like GetRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.

Parameters
surfacethe surface to read.
pthe coordinates, 0 <= x < width and 0 <= y < height.
ra pointer filled in with the red channel, 0-255, or nullptr to ignore this channel.
ga pointer filled in with the green channel, 0-255, or nullptr to ignore this channel.
ba pointer filled in with the blue channel, 0-255, or nullptr to ignore this channel.
aa pointer filled in with the alpha channel, 0-255, or nullptr to ignore this channel.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ ReadSurfacePixelFloat()

void SDL::ReadSurfacePixelFloat ( SurfaceConstParam  surface,
const PointRaw p,
float *  r,
float *  g,
float *  b,
float *  a 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Parameters
surfacethe surface to read.
pthe coordinates, 0 <= x < width and 0 <= y < height.
ra pointer filled in with the red channel, normally in the range 0-1, or nullptr to ignore this channel.
ga pointer filled in with the green channel, normally in the range 0-1, or nullptr to ignore this channel.
ba pointer filled in with the blue channel, normally in the range 0-1, or nullptr to ignore this channel.
aa pointer filled in with the alpha channel, normally in the range 0-1, or nullptr to ignore this channel.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ RemoveAlternateImages()

void SDL::Surface::RemoveAlternateImages ( )
inline

This function removes a reference from all the alternative versions, destroying them if this is the last reference to them.

Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.GetImages
Surface.HasAlternateImages

◆ RemoveSurfaceAlternateImages()

void SDL::RemoveSurfaceAlternateImages ( SurfaceParam  surface)
inline

This function removes a reference from all the alternative versions, destroying them if this is the last reference to them.

Parameters
surfacethe Surface structure to update.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.GetImages
Surface.HasAlternateImages

◆ SaveBMP() [1/4]

void SDL::Surface::SaveBMP ( IOStreamParam  dst,
bool  closeio = false 
) const
inline

Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the BMP directly. Other RGB formats with 8-bit or higher get converted to a 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit surface before they are saved. YUV and paletted 1-bit and 4-bit formats are not supported.

Parameters
dsta data stream to save to.
closeioif true, calls IOStream.Close() on dst before returning, even in the case of an error.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.LoadBMP
Surface.SaveBMP

◆ SaveBMP() [2/4]

void SDL::Surface::SaveBMP ( StringParam  file) const
inline

Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the BMP directly. Other RGB formats with 8-bit or higher get converted to a 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit surface before they are saved. YUV and paletted 1-bit and 4-bit formats are not supported.

Parameters
filea file to save to.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.LoadBMP
Surface.SaveBMP

◆ SaveBMP() [3/4]

void SDL::SaveBMP ( SurfaceConstParam  surface,
IOStreamParam  dst,
bool  closeio = false 
)
inline

Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the BMP directly. Other RGB formats with 8-bit or higher get converted to a 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit surface before they are saved. YUV and paletted 1-bit and 4-bit formats are not supported.

Parameters
surfacethe Surface structure containing the image to be saved.
dsta data stream to save to.
closeioif true, calls IOStream.Close() on dst before returning, even in the case of an error.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.LoadBMP
Surface.SaveBMP

◆ SaveBMP() [4/4]

void SDL::SaveBMP ( SurfaceConstParam  surface,
StringParam  file 
)
inline

Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the BMP directly. Other RGB formats with 8-bit or higher get converted to a 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit surface before they are saved. YUV and paletted 1-bit and 4-bit formats are not supported.

Parameters
surfacethe Surface structure containing the image to be saved.
filea file to save to.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.LoadBMP
Surface.SaveBMP

◆ Scale()

Surface SDL::Surface::Scale ( const PointRaw size,
ScaleMode  scaleMode 
) const
inline
Parameters
sizethe width and height of the new surface.
scaleModethe ScaleMode to be used.
Returns
a copy of the surface or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy

◆ ScaleSurface()

Surface SDL::ScaleSurface ( SurfaceConstParam  surface,
const PointRaw size,
ScaleMode  scaleMode 
)
inline

The returned surface should be freed with Surface.Destroy().

Parameters
surfacethe surface to duplicate and scale.
sizethe width and height of the surface.
scaleModethe ScaleMode to be used.
Returns
a copy of the surface or nullptr on failure; call GetError() for more information.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Destroy

◆ SetAlphaMod()

void SDL::Surface::SetAlphaMod ( Uint8  alpha)
inline

When this surface is blitted, during the blit operation the source alpha value is modulated by this alpha value according to the following formula:

srcA = srcA * (alpha / 255)

Parameters
alphathe alpha value multiplied into blit operations.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetAlphaMod
Surface.SetColorMod

◆ SetBlendMode()

void SDL::Surface::SetBlendMode ( BlendMode  blendMode)
inline

To copy a surface to another surface (or texture) without blending with the existing data, the blendmode of the SOURCE surface should be set to BLENDMODE_NONE.

Parameters
blendModethe BlendMode to use for blit blending.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetBlendMode

◆ SetClipRect()

bool SDL::Surface::SetClipRect ( OptionalRef< const RectRaw rect)
inline

When surface is the destination of a blit, only the area within the clip rectangle is drawn into.

Note that blits are automatically clipped to the edges of the source and destination surfaces.

Parameters
rectthe Rect structure representing the clipping rectangle, or nullptr to disable clipping.
Returns
true if the rectangle intersects the surface, otherwise false and blits will be completely clipped.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.ResetClipRect()
Surface.GetClipRect

◆ SetColorKey()

void SDL::Surface::SetColorKey ( std::optional< Uint32 key)
inline

The color key defines a pixel value that will be treated as transparent in a blit. For example, one can use this to specify that cyan pixels should be considered transparent, and therefore not rendered.

It is a pixel of the format used by the surface, as generated by MapRGB().

Parameters
keythe transparent pixel or std::nullopt to disable it.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorKey
Surface.SetRLE
Surface.HasColorKey

◆ SetColorMod()

void SDL::Surface::SetColorMod ( Uint8  r,
Uint8  g,
Uint8  b 
)
inline

When this surface is blitted, during the blit operation each source color channel is modulated by the appropriate color value according to the following formula:

srcC = srcC * (color / 255)

Parameters
rthe red color value multiplied into blit operations.
gthe green color value multiplied into blit operations.
bthe blue color value multiplied into blit operations.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorMod
Surface.SetAlphaMod

◆ SetColorspace()

void SDL::Surface::SetColorspace ( Colorspace  colorspace)
inline

Setting the colorspace doesn't change the pixels, only how they are interpreted in color operations.

Parameters
colorspacea Colorspace value describing the surface colorspace.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorspace

◆ SetPalette()

void SDL::Surface::SetPalette ( PaletteParam  palette)
inline

A single palette can be shared with many surfaces.

Parameters
palettethe Palette structure to use.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Palette.Palette
Surface.GetPalette

◆ SetRLE()

void SDL::Surface::SetRLE ( bool  enabled)
inline

If RLE is enabled, color key and alpha blending blits are much faster, but the surface must be locked before directly accessing the pixels.

Parameters
enabledtrue to enable RLE acceleration, false to disable it.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit
Surface.Lock
Surface.Unlock

◆ SetSurfaceAlphaMod()

void SDL::SetSurfaceAlphaMod ( SurfaceParam  surface,
Uint8  alpha 
)
inline

When this surface is blitted, during the blit operation the source alpha value is modulated by this alpha value according to the following formula:

srcA = srcA * (alpha / 255)

Parameters
surfacethe Surface structure to update.
alphathe alpha value multiplied into blit operations.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetAlphaMod
Surface.SetColorMod

◆ SetSurfaceBlendMode()

void SDL::SetSurfaceBlendMode ( SurfaceParam  surface,
BlendMode  blendMode 
)
inline

To copy a surface to another surface (or texture) without blending with the existing data, the blendmode of the SOURCE surface should be set to BLENDMODE_NONE.

Parameters
surfacethe Surface structure to update.
blendModethe BlendMode to use for blit blending.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetBlendMode

◆ SetSurfaceClipRect()

bool SDL::SetSurfaceClipRect ( SurfaceParam  surface,
OptionalRef< const RectRaw rect 
)
inline

When surface is the destination of a blit, only the area within the clip rectangle is drawn into.

Note that blits are automatically clipped to the edges of the source and destination surfaces.

Parameters
surfacethe Surface structure to be clipped.
rectthe Rect structure representing the clipping rectangle, or nullptr to disable clipping.
Returns
true if the rectangle intersects the surface, otherwise false and blits will be completely clipped.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetClipRect

◆ SetSurfaceColorKey()

void SDL::SetSurfaceColorKey ( SurfaceParam  surface,
std::optional< Uint32 key 
)
inline

The color key defines a pixel value that will be treated as transparent in a blit. For example, one can use this to specify that cyan pixels should be considered transparent, and therefore not rendered.

It is a pixel of the format used by the surface, as generated by MapRGB().

Parameters
surfacethe Surface structure to update.
keythe transparent pixel or std::nullopt to disable it.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorKey
Surface.SetRLE
Surface.HasColorKey

◆ SetSurfaceColorMod()

void SDL::SetSurfaceColorMod ( SurfaceParam  surface,
Uint8  r,
Uint8  g,
Uint8  b 
)
inline

When this surface is blitted, during the blit operation each source color channel is modulated by the appropriate color value according to the following formula:

srcC = srcC * (color / 255)

Parameters
surfacethe Surface structure to update.
rthe red color value multiplied into blit operations.
gthe green color value multiplied into blit operations.
bthe blue color value multiplied into blit operations.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorMod
Surface.SetAlphaMod

◆ SetSurfaceColorspace()

void SDL::SetSurfaceColorspace ( SurfaceParam  surface,
Colorspace  colorspace 
)
inline

Setting the colorspace doesn't change the pixels, only how they are interpreted in color operations.

Parameters
surfacethe Surface structure to update.
colorspacean Colorspace value describing the surface colorspace.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.GetColorspace

◆ SetSurfacePalette()

void SDL::SetSurfacePalette ( SurfaceParam  surface,
PaletteParam  palette 
)
inline

A single palette can be shared with many surfaces.

Parameters
surfacethe Surface structure to update.
palettethe Palette structure to use.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Palette.Palette
Surface.GetPalette

◆ SetSurfaceRLE()

void SDL::SetSurfaceRLE ( SurfaceParam  surface,
bool  enabled 
)
inline

If RLE is enabled, color key and alpha blending blits are much faster, but the surface must be locked before directly accessing the pixels.

Parameters
surfacethe Surface structure to optimize.
enabledtrue to enable RLE acceleration, false to disable it.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.
See also
Surface.Blit
Surface.Lock
Surface.Unlock

◆ Stretch()

void SDL::Surface::Stretch ( SurfaceParam  src,
OptionalRef< RectRaw srcrect,
OptionalRef< RectRaw dstrect,
ScaleMode  scaleMode 
)
inline
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire destination surface.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.4.0.
See also
Surface.BlitScaled

◆ StretchSurface()

void SDL::StretchSurface ( SurfaceParam  src,
OptionalRef< RectRaw srcrect,
SurfaceParam  dst,
OptionalRef< RectRaw dstrect,
ScaleMode  scaleMode 
)
inline
Parameters
srcthe Surface structure to be copied from.
srcrectthe Rect structure representing the rectangle to be copied, or nullptr to copy the entire surface.
dstthe Surface structure that is the blit target.
dstrectthe Rect structure representing the target rectangle in the destination surface, or nullptr to fill the entire destination surface.
scaleModethe ScaleMode to be used.
Exceptions
Erroron failure.
Thread safety:
Only one thread should be using the src and dst surfaces at any given time.
Since
This function is available since SDL 3.4.0.
See also
Surface.BlitScaled

◆ SurfaceHasAlternateImages()

bool SDL::SurfaceHasAlternateImages ( SurfaceConstParam  surface)
inline
Parameters
surfacethe Surface structure to query.
Returns
true if alternate versions are available or false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.AddAlternateImage
Surface.RemoveAlternateImages
Surface.GetImages

◆ SurfaceHasColorKey()

bool SDL::SurfaceHasColorKey ( SurfaceConstParam  surface)
inline

It is safe to pass a nullptr surface here; it will return false.

Parameters
surfacethe Surface structure to query.
Returns
true if the surface has a color key, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetColorKey
Surface.GetColorKey

◆ SurfaceHasRLE()

bool SDL::SurfaceHasRLE ( SurfaceConstParam  surface)
inline

It is safe to pass a nullptr surface here; it will return false.

Parameters
surfacethe Surface structure to query.
Returns
true if the surface is RLE enabled, false otherwise.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Surface.SetRLE

◆ Unlock()

void SDL::Surface::Unlock ( )
inline
Thread safety:
This function is not thread safe. The locking referred to by this function is making the pixels available for direct access, not thread-safe locking.
Since
This function is available since SDL 3.2.0.
See also
Surface.Lock

◆ UnlockSurface()

void SDL::UnlockSurface ( SurfaceParam  surface)
inline
Parameters
surfacethe Surface structure to be unlocked.
Thread safety:
This function is not thread safe. The locking referred to by this function is making the pixels available for direct access, not thread-safe locking.
Since
This function is available since SDL 3.2.0.
See also
Surface.Lock

◆ WritePixel()

void SDL::Surface::WritePixel ( const PointRaw p,
ColorRaw  c 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Like MapRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.

Parameters
pthe coordinates, 0 <= x < width and 0 <= y < height.
cthe color values, 0-255.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ WritePixelFloat()

void SDL::Surface::WritePixelFloat ( const PointRaw p,
const FColorRaw c 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Parameters
pthe coordinates, 0 <= x < width and 0 <= y < height.
cthe color values, normally in the range 0-1.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ WriteSurfacePixel()

void SDL::WriteSurfacePixel ( SurfaceParam  surface,
const PointRaw p,
ColorRaw  c 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Like MapRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.

Parameters
surfacethe surface to write.
pthe coordinates, 0 <= x < width, 0 <= y < height.
cthe color channels value, 0-255.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

◆ WriteSurfacePixelFloat()

void SDL::WriteSurfacePixelFloat ( SurfaceParam  surface,
const PointRaw p,
const FColorRaw c 
)
inline

This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.

Parameters
surfacethe surface to write.
pthe coordinates, 0 <= x < width, 0 <= y < height.
cthe color channels values, normally in the range 0-1.
Exceptions
Erroron failure.
Thread safety:
This function is not thread safe.
Since
This function is available since SDL 3.2.0.

Variable Documentation

◆ SCALEMODE_LINEAR

constexpr ScaleMode SDL::SCALEMODE_LINEAR
constexpr
Initial value:
=
SDL_SCALEMODE_LINEAR

◆ SCALEMODE_NEAREST

constexpr ScaleMode SDL::SCALEMODE_NEAREST
constexpr
Initial value:
=
SDL_SCALEMODE_NEAREST

◆ SURFACE_LOCK_NEEDED

constexpr SurfaceFlags SDL::SURFACE_LOCK_NEEDED
constexpr
Initial value:
=
SDL_SURFACE_LOCK_NEEDED

◆ SURFACE_LOCKED

constexpr SurfaceFlags SDL::SURFACE_LOCKED
constexpr
Initial value:
=
SDL_SURFACE_LOCKED

◆ SURFACE_PREALLOCATED

constexpr SurfaceFlags SDL::SURFACE_PREALLOCATED
constexpr
Initial value:
=
SDL_SURFACE_PREALLOCATED