sdlSetSurfaceBlendMode function

bool sdlSetSurfaceBlendMode(
  1. Pointer<SdlSurface> surface,
  2. int blendMode
)

Set the blend mode used for blit operations.

To copy a surface to another surface (or texture) without blending with the existing data, the blendmode of the SOURCE surface should be set to SDL_BLENDMODE_NONE.

\param surface the SDL_Surface structure to update. \param blendMode the SDL_BlendMode to use for blit blending. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_GetSurfaceBlendMode

extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode)

Implementation

bool sdlSetSurfaceBlendMode(Pointer<SdlSurface> surface, int blendMode) {
  final sdlSetSurfaceBlendModeLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlSurface> surface, Uint32 blendMode),
      int Function(Pointer<SdlSurface> surface,
          int blendMode)>('SDL_SetSurfaceBlendMode');
  return sdlSetSurfaceBlendModeLookupFunction(surface, blendMode) == 1;
}