Texture.this - multiple declarations

Function Texture.this

Constructs a dsdl2.Texture from a vanilla SDL_Texture* from bindbc-sdl

this (
  sdl.render.SDL_Texture* sdlTexture,
  bool isOwner = true,
  void* userRef = null
);

Parameters

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

Function Texture.this

Creates a blank dsdl2.Texture in the VRAM, which wraps SDL_CreateTexture

this (
  Renderer renderer,
  PixelFormat pixelFormat,
  TextureAccess access,
  uint[2] size
) @trusted;

Parameters

NameDescription
renderer dsdl2.Renderer the texture belongs to
pixelFormat dsdl2.PixelFormat that the texture pixel data is stored as
access dsdl2.TextureAccess enumeration which indicates its access rule
size the size of the texture (width and height)

Throws

dsdl2.SDLException if creation failed

Function Texture.this

Creates a dsdl2.Texture in the VRAM from a dsdl2.Surface, which wraps SDL_CreateTextureFromSurface

this (
  Renderer renderer,
  Surface surface
) @trusted;

Parameters

NameDescription
renderer dsdl2.Renderer the texture belongs to
surface dsdl2.Surface for its pixel data to be copied over to the texture

Throws

dsdl2.SDLException if creation failed