Draw multiple points on the current rendering target at subpixel precision.
Defined in SDL_render.h
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.
#define WIDTH 640
#define HEIGHT 480
// Calculate centre of the screen
double x_centre = WIDTH / 2;
double y_centre = HEIGHT / 2;
/* ... */
SDL_Renderer *renderer;
// Initialize three points of triangle
SDL_FPoint a = {x_centre, y_centre};
SDL_FPoint b = {x_centre, y_centre - 10.5};
SDL_FPoint c = {x_centre - 10.5, y_centre};
// Initialize array of points
SDL_FPoint triangle[] = {
a,
b,
c
};
/* ... */
// Set render color to white
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_RenderClear(renderer);
// Draw triangle
SDL_RenderDrawPointsF(renderer, triangle, 3);
SDL_RenderPresent(renderer);