sdlSetSurfaceColorMod function

int sdlSetSurfaceColorMod(
  1. Pointer<SdlSurface> surface,
  2. int r,
  3. int g,
  4. int b,
)

Set an additional color value multiplied into blit operations.

When this surface is blitted, during the blit operation each source color channel is modulated by the appropriate color value according to the following formula:

srcC = srcC * (color / 255)

\param surface the SDL_Surface structure to update \param r the red color value multiplied into blit operations \param g the green color value multiplied into blit operations \param b the blue color value multiplied into blit operations \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GetSurfaceColorMod \sa SDL_SetSurfaceAlphaMod

extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b)

Implementation

int sdlSetSurfaceColorMod(Pointer<SdlSurface> surface, int r, int g, int b) {
  final sdlSetSurfaceColorModLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlSurface> surface, Uint8 r, Uint8 g, Uint8 b),
      int Function(Pointer<SdlSurface> surface, int r, int g,
          int b)>('SDL_SetSurfaceColorMod');
  return sdlSetSurfaceColorModLookupFunction(surface, r, g, b);
}