sdlSetTextureColorMod function
Set an additional color value multiplied into render copy operations.
When this texture is rendered, during the copy operation each source color channel is modulated by the appropriate color value according to the following formula:
srcC = srcC * (color / 255)
Color modulation is not always supported by the renderer; it will return false if color modulation is not supported.
\param texture the texture to update. \param r the red color value multiplied into copy operations. \param g the green color value multiplied into copy operations. \param b the blue color value multiplied into copy operations. \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.1.3.
\sa SDL_GetTextureColorMod \sa SDL_SetTextureAlphaMod \sa SDL_SetTextureColorModFloat
extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
Implementation
bool sdlSetTextureColorMod(Pointer<SdlTexture> texture, int r, int g, int b) {
final sdlSetTextureColorModLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<SdlTexture> texture, Uint8 r, Uint8 g, Uint8 b),
int Function(Pointer<SdlTexture> texture, int r, int g,
int b)>('SDL_SetTextureColorMod');
return sdlSetTextureColorModLookupFunction(texture, r, g, b) == 1;
}