Draw multiple points on the current rendering target at subpixel precision.
int SDL_RenderDrawPointsF(SDL_Renderer * renderer,
const SDL_FPoint * points,
int count);
renderer | The renderer which should draw multiple points. |
points | The points to draw |
count | The number of points to draw |
Return 0 on success, or -1 on error
This function is available since SDL 2.0.10.
// Calculate centre of the screen
double x_centre = WIDTH / 2;
double y_centre = HEIGHT / 2;
...
// Initialize three points of triangle
SDL_FPoint a = {x_centre, y_centre};10.5};
SDL_FPoint b = {x_centre, y_centre - 10.5, y_centre};
SDL_FPoint c = {x_centre -
// Initialize array of points
SDL_FPoint triangle[] = {
a,
b,
c
};
...
// Set render color to white
255, 255, 255, 255);
SDL_SetRenderDrawColor(renderer,
SDL_RenderClear(renderer);
// Draw triangle
3);
SDL_RenderDrawPointsF(renderer, triangle,
SDL_RenderPresent(renderer);