sdlSetRenderDrawColorFloat function render

bool sdlSetRenderDrawColorFloat(
  1. Pointer<SdlRenderer> renderer,
  2. double r,
  3. double g,
  4. double b,
  5. double a,
)

Set the color used for drawing operations (Rect, Line and Clear).

Set the color for drawing or filling rectangles, lines, and points, and for SDL_RenderClear().

\param renderer the rendering context. \param r the red value used to draw on the rendering target. \param g the green value used to draw on the rendering target. \param b the blue value used to draw on the rendering target. \param a the alpha value used to draw on the rendering target. Use SDL_SetRenderDrawBlendMode to specify how the alpha channel is used. \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_GetRenderDrawColorFloat \sa SDL_SetRenderDrawColor

extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a)

Implementation

bool sdlSetRenderDrawColorFloat(
  Pointer<SdlRenderer> renderer,
  double r,
  double g,
  double b,
  double a,
) {
  final sdlSetRenderDrawColorFloatLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(
          Pointer<SdlRenderer> renderer,
          Float r,
          Float g,
          Float b,
          Float a,
        ),
        int Function(
          Pointer<SdlRenderer> renderer,
          double r,
          double g,
          double b,
          double a,
        )
      >('SDL_SetRenderDrawColorFloat');
  return sdlSetRenderDrawColorFloatLookupFunction(renderer, r, g, b, a) == 1;
}