sdlxWriteSurfacePixel function surface
Writes a single pixel to a surface.
This function prioritizes correctness over speed: it is suitable for unit tests, but is not intended for use in a game engine.
Like SDL_MapRGBA, this uses the entire 0..255 range when converting color components from pixel formats with less than 8 bits per RGB component.
\param surface the surface to write. \param x the horizontal coordinate, 0 <= x < width. \param y the vertical coordinate, 0 <= y < height. \param r the red channel value, 0-255. \param g the green channel value, 0-255. \param b the blue channel value, 0-255. \param a the alpha channel value, 0-255. \returns true on success or false on failure; call SDL_GetError() for more information.
\threadsafety This function can be called on different threads with different surfaces.
\since This function is available since SDL 3.2.0.
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Implementation
bool sdlxWriteSurfacePixel(
Pointer<SdlSurface> surface,
SdlxPoint point,
SdlxColor color,
) => sdlWriteSurfacePixel(
surface,
point.x,
point.y,
color.r,
color.g,
color.b,
color.a,
);