summaryrefslogtreecommitdiff
path: root/sdl2
diff options
context:
space:
mode:
authorPierre-Antoine Rouby <contact@parouby.fr>2019-05-24 22:22:45 +0200
committerDavid Thompson <dthompson2@worcester.edu>2019-05-27 20:40:53 -0400
commit9ffb8b1f126dfbf3a7e4a2d68d2e77afeca26a83 (patch)
treeca28e69f0d4d75d81dd1d1474e14794a169dd09a /sdl2
parent7e65331c7a6a7a3c2e70b072241db5742c1cb27d (diff)
render: Add SDL_RenderDrawPoint binding.
* sdl2/bindings.scm (sdl-render-draw-line): New procedure. * sdl2/render.scm (render-draw-line): New procedure. * doc/api.texi (Rendering): Document it.
Diffstat (limited to 'sdl2')
-rw-r--r--sdl2/bindings.scm4
-rw-r--r--sdl2/render.scm6
2 files changed, 10 insertions, 0 deletions
diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm
index c31bbd2..e81abf7 100644
--- a/sdl2/bindings.scm
+++ b/sdl2/bindings.scm
@@ -1,6 +1,7 @@
;;; guile-sdl2 --- FFI bindings for SDL2
;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2018 Eero Leno <eero@leno.fi>
+;;; Copyright © 2019 Pierre-Antoine Rouby <contact@parouby.fr>
;;;
;;; This file is part of guile-sdl2.
;;;
@@ -248,6 +249,9 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
(define-foreign sdl-render-draw-line
int "SDL_RenderDrawLine" (list '* int int int int))
+(define-foreign sdl-render-draw-point
+ int "SDL_RenderDrawPoint" (list '* int int))
+
;;;
;;; Events
diff --git a/sdl2/render.scm b/sdl2/render.scm
index 18b800d..9e4bf57 100644
--- a/sdl2/render.scm
+++ b/sdl2/render.scm
@@ -1,5 +1,6 @@
;;; guile-sdl2 --- FFI bindings for SDL2
;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;; Copyright © 2019 Pierre-Antoine Rouby <contact@parouby.fr>
;;;
;;; This file is part of guile-sdl2.
;;;
@@ -38,6 +39,7 @@
render-copy
set-render-draw-color
render-draw-line
+ render-draw-point
surface->texture))
@@ -111,6 +113,10 @@ color."
"Draw line on RENDERER."
(ffi:sdl-render-draw-line (unwrap-renderer renderer) x1 y1 x2 y2))
+(define (render-draw-point renderer x y)
+ "Draw point on RENDERER."
+ (ffi:sdl-render-draw-point (unwrap-renderer renderer) x y))
+
;;;
;;; Texture