surface topic
CategorySurface
SDL surfaces are buffers of pixels in system RAM. These are useful for passing around and manipulating images that are not stored in GPU memory.
SDL_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, SDL_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 :
Classes
Functions
-
sdlAddSurfaceAlternateImage(
Pointer< surfaceSdlSurface> surface, Pointer<SdlSurface> image) → bool - Add an alternate version of a surface.
-
sdlBlitSurface(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect) → bool - Performs a fast blit from the source surface to the destination surface with clipping.
-
sdlBlitSurface9Grid(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, int leftWidth, int rightWidth, int topHeight, int bottomHeight, double scale, int scaleMode, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect) → bool - Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format.
-
sdlBlitSurfaceScaled(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect, int scaleMode) → bool - Perform a scaled blit to a destination surface, which may be of a different format.
-
sdlBlitSurfaceTiled(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect) → bool - Perform a tiled blit to a destination surface, which may be of a different format.
-
sdlBlitSurfaceTiledWithScale(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, double scale, int scaleMode, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect) → bool - Perform a scaled and tiled blit to a destination surface, which may be of a different format.
-
sdlBlitSurfaceUnchecked(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect) → bool - Perform low-level surface blitting only.
-
sdlBlitSurfaceUncheckedScaled(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect, int scaleMode) → bool - Perform low-level surface scaled blitting only.
-
sdlClearSurface(
Pointer< surfaceSdlSurface> surface, double r, double g, double b, double a) → bool - Clear a surface with a specific color, with floating point precision.
-
sdlConvertPixels(
int width, int height, int srcFormat, Pointer< surfaceNativeType> src, int srcPitch, int dstFormat, Pointer<NativeType> dst, int dstPitch) → bool - Copy a block of pixels of one format to another format.
-
sdlConvertPixelsAndColorspace(
int width, int height, int srcFormat, int srcColorspace, int srcProperties, Pointer< surfaceNativeType> src, int srcPitch, int dstFormat, int dstColorspace, int dstProperties, Pointer<NativeType> dst, int dstPitch) → bool - Copy a block of pixels of one format and colorspace to another format and colorspace.
-
sdlConvertSurface(
Pointer< surfaceSdlSurface> surface, int format) → Pointer<SdlSurface> - Copy an existing surface to a new surface of the specified format.
-
sdlConvertSurfaceAndColorspace(
Pointer< surfaceSdlSurface> surface, int format, Pointer<SdlPalette> palette, int colorspace, int props) → Pointer<SdlSurface> - Copy an existing surface to a new surface of the specified format and colorspace.
-
sdlCreateSurface(
int width, int height, int format) → Pointer< surfaceSdlSurface> - Allocate a new surface with a specific pixel format.
-
sdlCreateSurfaceFrom(
int width, int height, int format, Pointer< surfaceNativeType> pixels, int pitch) → Pointer<SdlSurface> - Allocate a new surface with a specific pixel format and existing pixel data.
-
sdlCreateSurfacePalette(
Pointer< surfaceSdlSurface> surface) → Pointer<SdlPalette> - Create a palette and associate it with a surface.
-
sdlDestroySurface(
Pointer< surfaceSdlSurface> surface) → void - Free a surface.
-
sdlDuplicateSurface(
Pointer< surfaceSdlSurface> surface) → Pointer<SdlSurface> - Creates a new surface identical to the existing surface.
-
sdlFillSurfaceRect(
Pointer< surfaceSdlSurface> dst, Pointer<SdlRect> rect, int color) → bool - Perform a fast fill of a rectangle with a specific color.
-
sdlFillSurfaceRects(
Pointer< surfaceSdlSurface> dst, Pointer<SdlRect> rects, int count, int color) → bool - Perform a fast fill of a set of rectangles with a specific color.
-
sdlFlipSurface(
Pointer< surfaceSdlSurface> surface, int flip) → bool - Flip a surface vertically or horizontally.
-
sdlGetSurfaceAlphaMod(
Pointer< surfaceSdlSurface> surface, Pointer<Uint8> alpha) → bool - Get the additional alpha value used in blit operations.
-
sdlGetSurfaceBlendMode(
Pointer< surfaceSdlSurface> surface, Pointer<Uint32> blendMode) → bool - Get the blend mode used for blit operations.
-
sdlGetSurfaceClipRect(
Pointer< surfaceSdlSurface> surface, Pointer<SdlRect> rect) → bool - Get the clipping rectangle for a surface.
-
sdlGetSurfaceColorKey(
Pointer< surfaceSdlSurface> surface, Pointer<Uint32> key) → bool - Get the color key (transparent pixel) for a surface.
-
sdlGetSurfaceColorMod(
Pointer< surfaceSdlSurface> surface, Pointer<Uint8> r, Pointer<Uint8> g, Pointer<Uint8> b) → bool - Get the additional color value multiplied into blit operations.
-
sdlGetSurfaceColorspace(
Pointer< surfaceSdlSurface> surface) → int - Get the colorspace used by a surface.
-
sdlGetSurfaceImages(
Pointer< surfaceSdlSurface> surface, Pointer<Int32> count) → Pointer<Pointer< SdlSurface> > - Get an array including all versions of a surface.
-
sdlGetSurfacePalette(
Pointer< surfaceSdlSurface> surface) → Pointer<SdlPalette> - Get the palette used by a surface.
-
sdlGetSurfaceProperties(
Pointer< surfaceSdlSurface> surface) → int - Get the properties associated with a surface.
-
sdlLoadBmp(
String? file) → Pointer< surfaceSdlSurface> - Load a BMP image from a file.
-
sdlLoadBmpIo(
Pointer< surfaceSdlIoStream> src, bool closeio) → Pointer<SdlSurface> - Load a BMP image from a seekable SDL data stream.
-
sdlLockSurface(
Pointer< surfaceSdlSurface> surface) → bool - Set up a surface for directly accessing the pixels.
-
sdlMapSurfaceRgb(
Pointer< surfaceSdlSurface> surface, int r, int g, int b) → int - Map an RGB triple to an opaque pixel value for a surface.
-
sdlMapSurfaceRgba(
Pointer< surfaceSdlSurface> surface, int r, int g, int b, int a) → int - Map an RGBA quadruple to a pixel value for a surface.
-
sdlPremultiplyAlpha(
int width, int height, int srcFormat, Pointer< surfaceNativeType> src, int srcPitch, int dstFormat, Pointer<NativeType> dst, int dstPitch, bool linear) → bool - Premultiply the alpha on a block of pixels.
-
sdlPremultiplySurfaceAlpha(
Pointer< surfaceSdlSurface> surface, bool linear) → bool - Premultiply the alpha in a surface.
-
sdlReadSurfacePixel(
Pointer< surfaceSdlSurface> surface, int x, int y, Pointer<Uint8> r, Pointer<Uint8> g, Pointer<Uint8> b, Pointer<Uint8> a) → bool - Retrieves a single pixel from a surface.
-
sdlReadSurfacePixelFloat(
Pointer< surfaceSdlSurface> surface, int x, int y, Pointer<Float> r, Pointer<Float> g, Pointer<Float> b, Pointer<Float> a) → bool - Retrieves a single pixel from a surface.
-
sdlRemoveSurfaceAlternateImages(
Pointer< surfaceSdlSurface> surface) → void - Remove all alternate versions of a surface.
-
sdlSaveBmp(
Pointer< surfaceSdlSurface> surface, String? file) → bool - Save a surface to a file.
-
sdlSaveBmpIo(
Pointer< surfaceSdlSurface> surface, Pointer<SdlIoStream> dst, bool closeio) → bool - Save a surface to a seekable SDL data stream in BMP format.
-
sdlScaleSurface(
Pointer< surfaceSdlSurface> surface, int width, int height, int scaleMode) → Pointer<SdlSurface> - Creates a new surface identical to the existing surface, scaled to the desired size.
-
sdlSetSurfaceAlphaMod(
Pointer< surfaceSdlSurface> surface, int alpha) → bool - Set an additional alpha value used in blit operations.
-
sdlSetSurfaceBlendMode(
Pointer< surfaceSdlSurface> surface, int blendMode) → bool - Set the blend mode used for blit operations.
-
sdlSetSurfaceClipRect(
Pointer< surfaceSdlSurface> surface, Pointer<SdlRect> rect) → bool - Set the clipping rectangle for a surface.
-
sdlSetSurfaceColorKey(
Pointer< surfaceSdlSurface> surface, bool enabled, int key) → bool - Set the color key (transparent pixel) in a surface.
-
sdlSetSurfaceColorMod(
Pointer< surfaceSdlSurface> surface, int r, int g, int b) → bool - Set an additional color value multiplied into blit operations.
-
sdlSetSurfaceColorspace(
Pointer< surfaceSdlSurface> surface, int colorspace) → bool - Set the colorspace used by a surface.
-
sdlSetSurfacePalette(
Pointer< surfaceSdlSurface> surface, Pointer<SdlPalette> palette) → bool - Set the palette used by a surface.
-
sdlSetSurfaceRle(
Pointer< surfaceSdlSurface> surface, bool enabled) → bool - Set the RLE acceleration hint for a surface.
-
sdlStretchSurface(
Pointer< surfaceSdlSurface> src, Pointer<SdlRect> srcrect, Pointer<SdlSurface> dst, Pointer<SdlRect> dstrect, int scaleMode) → bool - Perform a stretched pixel copy from one surface to another.
-
sdlSurfaceHasAlternateImages(
Pointer< surfaceSdlSurface> surface) → bool - Return whether a surface has alternate versions available.
-
sdlSurfaceHasColorKey(
Pointer< surfaceSdlSurface> surface) → bool - Returns whether the surface has a color key.
-
sdlSurfaceHasRle(
Pointer< surfaceSdlSurface> surface) → bool - Returns whether the surface is RLE enabled.
-
sdlUnlockSurface(
Pointer< surfaceSdlSurface> surface) → void - Release a surface after directly accessing the pixels.
-
sdlWriteSurfacePixel(
Pointer< surfaceSdlSurface> surface, int x, int y, int r, int g, int b, int a) → bool - Writes a single pixel to a surface.
-
sdlWriteSurfacePixelFloat(
Pointer< surfaceSdlSurface> surface, int x, int y, double r, double g, double b, double a) → bool - Writes a single pixel to a surface.