sdl.surface

SDL Surfaces

Members

Aliases

SDL_SurfaceFlags
alias SDL_SurfaceFlags = Uint32

The flags on an SDL_Surface.

Enums

SDL_FlipMode
enum SDL_FlipMode

The flip mode.

SDL_ScaleMode
enum SDL_ScaleMode

The scaling mode.

Functions

SDL_AddSurfaceAlternateImage
bool SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image)

Add an alternate version of a surface.

SDL_BlitSurface
bool SDL_BlitSurface(SDL_Surface* src, const(SDL_Rect)* srcrect, SDL_Surface* dst, const(SDL_Rect)* dstrect)

Performs a fast blit from the source surface to the destination surface with clipping.

SDL_BlitSurface9Grid
bool SDL_BlitSurface9Grid(SDL_Surface* src, const(SDL_Rect)* srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, const(SDL_Rect)* dstrect)

Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format.

SDL_BlitSurfaceScaled
bool SDL_BlitSurfaceScaled(SDL_Surface* src, const(SDL_Rect)* srcrect, SDL_Surface* dst, const(SDL_Rect)* dstrect, SDL_ScaleMode scaleMode)

Perform a scaled blit to a destination surface, which may be of a different format.

SDL_BlitSurfaceTiled
bool SDL_BlitSurfaceTiled(SDL_Surface* src, const(SDL_Rect)* srcrect, SDL_Surface* dst, const(SDL_Rect)* dstrect)

Perform a tiled blit to a destination surface, which may be of a different format.

SDL_BlitSurfaceTiledWithScale
bool SDL_BlitSurfaceTiledWithScale(SDL_Surface* src, const(SDL_Rect)* srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, const(SDL_Rect)* dstrect)

Perform a scaled and tiled blit to a destination surface, which may be of a different format.

SDL_BlitSurfaceUnchecked
bool SDL_BlitSurfaceUnchecked(SDL_Surface* src, const(SDL_Rect)* srcrect, SDL_Surface* dst, const(SDL_Rect)* dstrect)

Perform low-level surface blitting only.

SDL_BlitSurfaceUncheckedScaled
bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, const(SDL_Rect)* srcrect, SDL_Surface* dst, const(SDL_Rect)* dstrect, SDL_ScaleMode scaleMode)

Perform low-level surface scaled blitting only.

SDL_ClearSurface
bool SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a)

Clear a surface with a specific color, with floating point precision.

SDL_ConvertPixels
bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const(void)* src, int src_pitch, SDL_PixelFormat dst_format, void* dst, int dst_pitch)

Copy a block of pixels of one format to another format.

SDL_ConvertPixelsAndColorspace
bool SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const(void)* src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void* dst, int dst_pitch)

Copy a block of pixels of one format and colorspace to another format and colorspace.

SDL_ConvertSurface
SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, SDL_PixelFormat format)

Copy an existing surface to a new surface of the specified format.

SDL_ConvertSurfaceAndColorspace
SDL_Surface* SDL_ConvertSurfaceAndColorspace(SDL_Surface* surface, SDL_PixelFormat format, SDL_Palette* palette, SDL_Colorspace colorspace, SDL_PropertiesID props)

Copy an existing surface to a new surface of the specified format and colorspace.

SDL_CreateSurface
SDL_Surface* SDL_CreateSurface(int width, int height, SDL_PixelFormat format)

Allocate a new surface with a specific pixel format.

SDL_CreateSurfaceFrom
SDL_Surface* SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, void* pixels, int pitch)

Allocate a new surface with a specific pixel format and existing pixel data.

SDL_CreateSurfacePalette
SDL_Palette* SDL_CreateSurfacePalette(SDL_Surface* surface)

Create a palette and associate it with a surface.

SDL_DestroySurface
void SDL_DestroySurface(SDL_Surface* surface)

Free a surface.

SDL_DuplicateSurface
SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface)

Creates a new surface identical to the existing surface.

SDL_FillSurfaceRect
bool SDL_FillSurfaceRect(SDL_Surface* dst, const(SDL_Rect)* rect, Uint32 color)

Perform a fast fill of a rectangle with a specific color.

SDL_FillSurfaceRects
bool SDL_FillSurfaceRects(SDL_Surface* dst, const(SDL_Rect)* rects, int count, Uint32 color)

Perform a fast fill of a set of rectangles with a specific color.

SDL_FlipSurface
bool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip)

Flip a surface vertically or horizontally.

SDL_GetSurfaceAlphaMod
bool SDL_GetSurfaceAlphaMod(SDL_Surface* surface, Uint8* alpha)

Get the additional alpha value used in blit operations.

SDL_GetSurfaceBlendMode
bool SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode)

Get the blend mode used for blit operations.

SDL_GetSurfaceClipRect
bool SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect)

Get the clipping rectangle for a surface.

SDL_GetSurfaceColorKey
bool SDL_GetSurfaceColorKey(SDL_Surface* surface, Uint32* key)

Get the color key (transparent pixel) for a surface.

SDL_GetSurfaceColorMod
bool SDL_GetSurfaceColorMod(SDL_Surface* surface, Uint8* r, Uint8* g, Uint8* b)

Get the additional color value multiplied into blit operations.

SDL_GetSurfaceColorspace
SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface* surface)

Get the colorspace used by a surface.

SDL_GetSurfaceImages
SDL_Surface** SDL_GetSurfaceImages(SDL_Surface* surface, int* count)

Get an array including all versions of a surface.

SDL_GetSurfacePalette
SDL_Palette* SDL_GetSurfacePalette(SDL_Surface* surface)

Get the palette used by a surface.

SDL_GetSurfaceProperties
SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface* surface)

Get the properties associated with a surface.

SDL_LoadBMP
SDL_Surface* SDL_LoadBMP(const(char)* file)

Load a BMP image from a file.

SDL_LoadBMP_IO
SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, bool closeio)

Load a BMP image from a seekable SDL data stream.

SDL_LockSurface
bool SDL_LockSurface(SDL_Surface* surface)

Set up a surface for directly accessing the pixels.

SDL_MapSurfaceRGB
Uint32 SDL_MapSurfaceRGB(SDL_Surface* surface, Uint8 r, Uint8 g, Uint8 b)

Map an RGB triple to an opaque pixel value for a surface.

SDL_MapSurfaceRGBA
Uint32 SDL_MapSurfaceRGBA(SDL_Surface* surface, Uint8 r, Uint8 g, Uint8 b, Uint8 a)

Map an RGBA quadruple to a pixel value for a surface.

SDL_PremultiplyAlpha
bool SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const(void)* src, int src_pitch, SDL_PixelFormat dst_format, void* dst, int dst_pitch, bool linear)

Premultiply the alpha on a block of pixels.

SDL_PremultiplySurfaceAlpha
bool SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, bool linear)

Premultiply the alpha in a surface.

SDL_ReadSurfacePixel
bool SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, Uint8* r, Uint8* g, Uint8* b, Uint8* a)

Retrieves a single pixel from a surface.

SDL_ReadSurfacePixelFloat
bool SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a)

Retrieves a single pixel from a surface.

SDL_RemoveSurfaceAlternateImages
void SDL_RemoveSurfaceAlternateImages(SDL_Surface* surface)

Remove all alternate versions of a surface.

SDL_SaveBMP
bool SDL_SaveBMP(SDL_Surface* surface, const(char)* file)

Save a surface to a file.

SDL_SaveBMP_IO
bool SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, bool closeio)

Save a surface to a seekable SDL data stream in BMP format.

SDL_ScaleSurface
SDL_Surface* SDL_ScaleSurface(SDL_Surface* surface, int width, int height, SDL_ScaleMode scaleMode)

Creates a new surface identical to the existing surface, scaled to the desired size.

SDL_SetSurfaceAlphaMod
bool SDL_SetSurfaceAlphaMod(SDL_Surface* surface, Uint8 alpha)

Set an additional alpha value used in blit operations.

SDL_SetSurfaceBlendMode
bool SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode)

Set the blend mode used for blit operations.

SDL_SetSurfaceClipRect
bool SDL_SetSurfaceClipRect(SDL_Surface* surface, const(SDL_Rect)* rect)

Set the clipping rectangle for a surface.

SDL_SetSurfaceColorKey
bool SDL_SetSurfaceColorKey(SDL_Surface* surface, bool enabled, Uint32 key)

Set the color key (transparent pixel) in a surface.

SDL_SetSurfaceColorMod
bool SDL_SetSurfaceColorMod(SDL_Surface* surface, Uint8 r, Uint8 g, Uint8 b)

Set an additional color value multiplied into blit operations.

SDL_SetSurfaceColorspace
bool SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace)

Set the colorspace used by a surface.

SDL_SetSurfacePalette
bool SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette)

Set the palette used by a surface.

SDL_SetSurfaceRLE
bool SDL_SetSurfaceRLE(SDL_Surface* surface, bool enabled)

Set the RLE acceleration hint for a surface.

SDL_SurfaceHasAlternateImages
bool SDL_SurfaceHasAlternateImages(SDL_Surface* surface)

Return whether a surface has alternate versions available.

SDL_SurfaceHasColorKey
bool SDL_SurfaceHasColorKey(SDL_Surface* surface)

Returns whether the surface has a color key.

SDL_SurfaceHasRLE
bool SDL_SurfaceHasRLE(SDL_Surface* surface)

Returns whether the surface is RLE enabled.

SDL_UnlockSurface
void SDL_UnlockSurface(SDL_Surface* surface)

Release a surface after directly accessing the pixels.

SDL_WriteSurfacePixel
bool SDL_WriteSurfacePixel(SDL_Surface* surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)

Writes a single pixel to a surface.

SDL_WriteSurfacePixelFloat
bool SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a)

Writes a single pixel to a surface.

Manifest constants

SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT
enum SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT
enum SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING
enum SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Structs

SDL_Surface
struct SDL_Surface

A collection of pixels used in software blitting.

Variables

SDL_SURFACE_LOCKED
enum SDL_SurfaceFlags SDL_SURFACE_LOCKED;

< Surface is currently locked

SDL_SURFACE_LOCK_NEEDED
enum SDL_SurfaceFlags SDL_SURFACE_LOCK_NEEDED;

< Surface needs to be locked to access pixels

SDL_SURFACE_PREALLOCATED
enum SDL_SurfaceFlags SDL_SURFACE_PREALLOCATED;

< Surface uses preallocated pixel memory

SDL_SURFACE_SIMD_ALIGNED
enum SDL_SurfaceFlags SDL_SURFACE_SIMD_ALIGNED;

< Surface uses pixel memory allocated with SDL_aligned_alloc()

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen