diff options
Diffstat (limited to 'sdl2/render.scm')
-rw-r--r-- | sdl2/render.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sdl2/render.scm b/sdl2/render.scm index 91236c6..326745f 100644 --- a/sdl2/render.scm +++ b/sdl2/render.scm @@ -40,6 +40,7 @@ set-render-draw-color render-draw-line render-draw-point + render-draw-points delete-texture! surface->texture)) @@ -118,6 +119,21 @@ color." "Draw point on RENDERER." (ffi:sdl-render-draw-point (unwrap-renderer renderer) x y)) +(define (render-draw-points renderer points) + "Draw POINTS on RENDERER." + (define (fill-bv bv l n) + (match l + (() bv) + (((x y) . r) + (s32vector-set! bv n x) + (s32vector-set! bv (+ n 1) y) + (fill-bv bv r (+ 2 n))))) + (let* ((count (length points)) + (bv (fill-bv (make-s32vector (* count 2)) points 0))) + (ffi:sdl-render-draw-points (unwrap-renderer renderer) + (bytevector->pointer bv) + count))) + ;;; ;;; Texture |