SDL School

API reference / Windows and drawing

SDL_RenderPoint

Function, SDL3

Colors one pixel with the current draw color.

Declaration

#include <SDL3/SDL.h>

bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y);

Parameters

rendererThe renderer.
xThe x position.
yThe y position.

Return value

True on success. On failure it returns false.

Example

Draw shapes
for (float dy = -RADIUS; dy <= RADIUS; dy += 12.0f) {
    for (float dx = -RADIUS; dx <= RADIUS; dx += 12.0f) {
        SDL_RenderPoint(renderer, x + dx, y + dy);
    }
}

See this code run in Draw shapes. Download the full program (.zip)

In SDL2

Use SDL_RenderDrawPointF for float positions.

See also