Skip to content

Commit d258379

Browse files
committed
Add TSDL_FPoint and related functions
1 parent 256ea45 commit d258379

File tree

2 files changed

+60
-4
lines changed

2 files changed

+60
-4
lines changed

sdlrect.inc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22

33
type
44
{**
5-
* The structure that defines a point
6-
*
7-
* SDL_EnclosePoints
5+
* The structure that defines a point (integer)
86
*}
9-
107
PSDL_Point = ^TSDL_Point;
118
TSDL_Point = record
129
x: SInt32;
1310
y: SInt32;
1411
end;
1512

13+
{**
14+
* The structure that defines a point (floating point)
15+
*}
16+
PSDL_FPoint = ^TSDL_FPoint;
17+
TSDL_FPoint = record
18+
x: Single;
19+
y: Single;
20+
end;
21+
1622
{**
1723
* A rectangle, with the origin at the upper left.
1824
*

sdlrenderer.inc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,18 @@ function SDL_RenderClear(renderer: PSDL_Renderer): SInt32 cdecl; external SDL_Li
585585
*}
586586
function SDL_RenderDrawPoint(renderer: PSDL_Renderer; x: SInt32; y: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPoint' {$ENDIF} {$ENDIF};
587587

588+
{**
589+
* Draw a point on the current rendering target.
590+
*
591+
* renderer The renderer which should draw a point.
592+
* x The x coordinate of the point.
593+
* y The y coordinate of the point.
594+
*
595+
* 0 on success, or -1 on error
596+
*}
597+
function SDL_RenderDrawPointF(renderer: PSDL_Renderer; x, y: single): SInt32 cdecl;
598+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPointF' {$ENDIF} {$ENDIF};
599+
588600
{**
589601
* Draw multiple points on the current rendering target.
590602
*
@@ -596,6 +608,18 @@ function SDL_RenderDrawPoint(renderer: PSDL_Renderer; x: SInt32; y: SInt32): SIn
596608
*}
597609
function SDL_RenderDrawPoints(renderer: PSDL_Renderer; points: PSDL_Point; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPoints' {$ENDIF} {$ENDIF};
598610

611+
{**
612+
* Draw multiple points on the current rendering target.
613+
*
614+
* renderer The renderer which should draw multiple points.
615+
* points The points to draw
616+
* count The number of points to draw
617+
*
618+
* 0 on success, or -1 on error
619+
*}
620+
function SDL_RenderDrawPointsF(renderer: PSDL_Renderer; points: PSDL_FPoint; count: SInt32): SInt32 cdecl;
621+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPointsF' {$ENDIF} {$ENDIF};
622+
599623
{**
600624
* Draw a line on the current rendering target.
601625
*
@@ -609,6 +633,20 @@ function SDL_RenderDrawPoints(renderer: PSDL_Renderer; points: PSDL_Point; count
609633
*}
610634
function SDL_RenderDrawLine(renderer: PSDL_Renderer; x1: SInt32; y1: SInt32; x2: SInt32; y2: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLine' {$ENDIF} {$ENDIF};
611635

636+
{**
637+
* Draw a line on the current rendering target.
638+
*
639+
* renderer The renderer which should draw a line.
640+
* x1 The x coordinate of the start point.
641+
* y1 The y coordinate of the start point.
642+
* x2 The x coordinate of the end point.
643+
* y2 The y coordinate of the end point.
644+
*
645+
* 0 on success, or -1 on error
646+
*}
647+
function SDL_RenderDrawLineF(renderer: PSDL_Renderer; x1, y1, x2, y2: single): SInt32 cdecl;
648+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLineF' {$ENDIF} {$ENDIF};
649+
612650
{**
613651
* \brief Draw a series of connected lines on the current rendering target.
614652
*
@@ -620,6 +658,18 @@ function SDL_RenderDrawLine(renderer: PSDL_Renderer; x1: SInt32; y1: SInt32; x2:
620658
*}
621659
function SDL_RenderDrawLines(renderer: PSDL_Renderer; points: PSDL_Point; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLines' {$ENDIF} {$ENDIF};
622660

661+
{**
662+
* Draw a series of connected lines on the current rendering target.
663+
*
664+
* renderer The renderer which should draw multiple lines.
665+
* points The points along the lines
666+
* count The number of points, drawing count-1 lines
667+
*
668+
* 0 on success, or -1 on error
669+
*}
670+
function SDL_RenderDrawLinesF(renderer: PSDL_Renderer; points: PSDL_FPoint; count: SInt32): SInt32 cdecl;
671+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLinesF' {$ENDIF} {$ENDIF};
672+
623673
{**
624674
* Draw a rectangle on the current rendering target.
625675
*

0 commit comments

Comments
 (0)