line method

bool line(
  1. Point<double> p1,
  2. Point<double> p2
)

Draw a line on the current rendering target at subpixel precision.

\param renderer the renderer which should draw a line. \param x1 the x coordinate of the start point. \param y1 the y coordinate of the start point. \param x2 the x coordinate of the end point. \param y2 the y coordinate of the end point. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_RenderLines

extern SDL_DECLSPEC bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2)

Implementation

bool line(math.Point<double> p1, math.Point<double> p2) {
  return sdlRenderLine(this, p1.x, p1.y, p2.x, p2.y);
}