Add binding for SDL_SetRenderDrawColor.
authorEero Leno <eero@leno.fi>
Tue, 21 Aug 2018 12:20:08 +0000 (15:20 +0300)
committerDavid Thompson <dthompson2@worcester.edu>
Tue, 21 Aug 2018 13:16:41 +0000 (09:16 -0400)
* sdl2/bindings.scm (sdl-set-render-draw-color): New procedure.
* sdl2/render.scm (set-render-draw-color): New procedure.

sdl2/bindings.scm
sdl2/render.scm

index d333c59..84e49b8 100644 (file)
@@ -1,5 +1,6 @@
 ;;; guile-sdl2 --- FFI bindings for SDL2
 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
+;;; Copyright © 2018 Eero Leno <eero@leno.fi>
 ;;;
 ;;; This file is part of guile-sdl2.
 ;;;
@@ -235,6 +236,9 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
 (define-foreign sdl-create-texture-from-surface
   '* "SDL_CreateTextureFromSurface" '(* *))
 
+(define-foreign sdl-set-render-draw-color
+  int "SDL_SetRenderDrawColor" (list '* uint8 uint8 uint8 uint8))
+
 \f
 ;;;
 ;;; Events
index 44df4a4..e2fb05c 100644 (file)
@@ -36,6 +36,7 @@
             clear-renderer
             present-renderer
             render-copy
+            set-render-draw-color
 
             surface->texture))
 
@@ -101,6 +102,10 @@ color."
   "Display RENDERER."
   (ffi:sdl-render-present (unwrap-renderer renderer)))
 
+(define (set-render-draw-color renderer r g b a)
+  "Set draw color of RENDERER."
+  (ffi:sdl-set-render-draw-color (unwrap-renderer renderer) r g b a))
+
 \f
 ;;;
 ;;; Texture