Surface.this - multiple declarations

Function Surface.this

Constructs a dsdl2.Surface from a vanilla SDL_Surface* from bindbc-sdl

this (
  sdl.surface.SDL_Surface* sdlSurface,
  bool isOwner = true,
  void* userRef = null
);

Parameters

NameDescription
sdlSurface the SDL_Surface pointer to manage
isOwner whether the instance owns the given SDL_Surface* and should destroy it on its own
userRef optional pointer to maintain reference link, avoiding GC cleanup

Function Surface.this

Constructs a blank RGB(A) dsdl2.Surface with a set width, height, and dsdl2.PixelFormat that wraps SDL_CreateRGBSurface

this (
  uint[2] size,
  const(PixelFormat) rgbPixelFormat
) @trusted;

Parameters

NameDescription
size size (width and height) of the dsdl2.Surface in pixels
rgbPixelFormat an RGB(A) dsdl2.PixelFormat

Throws

dsdl2.SDLException if allocation failed

Function Surface.this

Constructs an RGB(A) dsdl2.Surface from an array of pixels

this (
  const(void[]) pixels,
  uint[2] size,
  ulong pitch,
  const(PixelFormat) rgbPixelFormat
) @trusted;

Parameters

NameDescription
pixels array of pixel data (copied internally)
size size (width and height) of the dsdl2.Surface in pixels
pitch skips in bytes per line/row of the dsdl2.Surface
rgbPixelFormat an RGB(A) dsdl2.PixelFormat

Throws

dsdl2.SDLException if allocation failed

Function Surface.this

Constructs a blank indexed palette-using dsdl2.Surface with a set width, height, and index bit depth, which wraps SDL_CreateRGBSurface

this (
  uint[2] size,
  ubyte bitDepth,
  Palette palette
) @trusted;

Parameters

NameDescription
size size (width and height) of the dsdl2.Surface in pixels
bitDepth bit depth of the palette index (1, 4, or 8)
palette dsdl2.Palette to use

Throws

dsdl2.SDLException if allocation failed or palette-setting failed

Function Surface.this

Constructs a blank indexed palette-using dsdl2.Surface from an array of pixels

this (
  const(void[]) pixels,
  uint[2] size,
  ulong pitch,
  ubyte bitDepth,
  Palette palette
) @trusted;

Parameters

NameDescription
pixels array of pixel data (copied internally)
size size (width and height) of the dsdl2.Surface in pixels
pitch skips in bytes per line/row of the dsdl2.Surface
bitDepth bit depth of the palette index (1, 4, or 8)
palette dsdl2.Palette to use

Throws

dsdl2.SDLException if allocation failed or palette-setting failed