sdlxGetTextureColorMod function render

({int b, int g, int r})? sdlxGetTextureColorMod(
  1. Pointer<SdlTexture> texture
)

Get the additional color value multiplied into render copy operations.

\param texture the texture to query. \param r a pointer filled in with the current red color value. \param g a pointer filled in with the current green color value. \param b a pointer filled in with the current blue color value. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetTextureAlphaMod \sa SDL_GetTextureColorModFloat \sa SDL_SetTextureColorMod

extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b)

See also:

Implementation

({int r, int g, int b})? sdlxGetTextureColorMod(Pointer<SdlTexture> texture) {
  var r = 0;
  var g = 0;
  var b = 0;
  final rPointer = ffi.calloc<Uint8>();
  final gPointer = ffi.calloc<Uint8>();
  final bPointer = ffi.calloc<Uint8>();
  final result = sdlGetTextureColorMod(texture, rPointer, gPointer, bPointer);
  if (result) {
    r = rPointer.value;
    g = gPointer.value;
    b = bPointer.value;
  }
  rPointer.callocFree();
  gPointer.callocFree();
  bPointer.callocFree();
  if (!result) {
    return null;
  }
  return (r: r, g: g, b: b);
}