logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_WriteSurfacePixel - Writes a single pixel to a surface.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                           SDL_WriteSurfacePixel(3)

Description

       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.

Function Parameters

surface
              the surface to write.

       x      the horizontal coordinate, 0 <= x < width.

       y      the vertical coordinate, 0 <= y < height.

       r      the red channel value, 0-255.

       g      the green channel value, 0-255.

       b      the blue channel value, 0-255.

       a      the alpha channel value, 0-255.

Header File

       Defined in SDL3/SDL_surface.h

Name

       SDL_WriteSurfacePixel - Writes a single pixel to a surface.

Return Value

       Returns true on success or false on failure; call

       SDL_GetError () for more information.

Synopsis

#include"SDL3/SDL.h"boolSDL_WriteSurfacePixel(SDL_Surface*surface,intx,inty,Uint8r,Uint8g,Uint8b,Uint8a);

Thread Safety

       This function is not thread safe.

See Also