sdlSetTextureAlphaModFloat function

bool sdlSetTextureAlphaModFloat(
  1. Pointer<SdlTexture> texture,
  2. double alpha
)

Set an additional alpha value multiplied into render copy operations.

When this texture is rendered, during the copy operation the source alpha value is modulated by this alpha value according to the following formula:

srcA = srcA * alpha

Alpha modulation is not always supported by the renderer; it will return false if alpha modulation is not supported.

\param texture the texture to update. \param alpha the source alpha 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_GetTextureAlphaModFloat \sa SDL_SetTextureAlphaMod \sa SDL_SetTextureColorModFloat

extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha)

Implementation

bool sdlSetTextureAlphaModFloat(Pointer<SdlTexture> texture, double alpha) {
  final sdlSetTextureAlphaModFloatLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlTexture> texture, Float alpha),
      int Function(Pointer<SdlTexture> texture,
          double alpha)>('SDL_SetTextureAlphaModFloat');
  return sdlSetTextureAlphaModFloatLookupFunction(texture, alpha) == 1;
}