summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api.texi5
-rw-r--r--sdl2/bindings.scm3
-rw-r--r--sdl2/render.scm5
3 files changed, 13 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi
index 5be763c..6e9e945 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -1056,6 +1056,11 @@ Display @var{renderer}.
Copy @var{texture} to the rendering target of @var{renderer}.
@end deffn
+@deffn {Procedure} render-draw-line renderer x1 y1 x2 y2
+Draw a line from (@var{x1}, @var{y1}) to (@var{x2}, @var{y2}) on the
+current rendering target of @var{renderer}.
+@end deffn
+
@deffn {Procedure} surface->texture renderer surface
Convert @var{surface} to a texture suitable for @var{renderer}.
@end deffn
diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm
index 854bdc9..c31bbd2 100644
--- a/sdl2/bindings.scm
+++ b/sdl2/bindings.scm
@@ -245,6 +245,9 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
(define-foreign sdl-set-render-draw-color
int "SDL_SetRenderDrawColor" (list '* uint8 uint8 uint8 uint8))
+(define-foreign sdl-render-draw-line
+ int "SDL_RenderDrawLine" (list '* int int int int))
+
;;;
;;; Events
diff --git a/sdl2/render.scm b/sdl2/render.scm
index c91699d..18b800d 100644
--- a/sdl2/render.scm
+++ b/sdl2/render.scm
@@ -37,6 +37,7 @@
present-renderer
render-copy
set-render-draw-color
+ render-draw-line
surface->texture))
@@ -106,6 +107,10 @@ color."
"Set draw color of RENDERER."
(ffi:sdl-set-render-draw-color (unwrap-renderer renderer) r g b a))
+(define (render-draw-line renderer x1 y1 x2 y2)
+ "Draw line on RENDERER."
+ (ffi:sdl-render-draw-line (unwrap-renderer renderer) x1 y1 x2 y2))
+
;;;
;;; Texture