summaryrefslogtreecommitdiff
path: root/sdl2
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-11-10 21:23:01 -0500
committerDavid Thompson <dthompson2@worcester.edu>2017-11-10 21:23:01 -0500
commitf8cbe6fdced276cf0ce70c14c78bc2f5cfb4d8ee (patch)
treeadde2c6f3a76c9c653cd09e82e51624ac73e0c2d /sdl2
parentd4c9b381d931835f930608db9563434f312dbf67 (diff)
render: Fix broken render-copy procedure.
* sdl2/render.scm (render-copy): Make srcrect and dstrect optional and do not use nil? to check them.
Diffstat (limited to 'sdl2')
-rw-r--r--sdl2/render.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/sdl2/render.scm b/sdl2/render.scm
index 5b27990..44df4a4 100644
--- a/sdl2/render.scm
+++ b/sdl2/render.scm
@@ -122,15 +122,15 @@ color."
(sdl-error "surface->texture" "failed to convert surface to texture")
(wrap-texture ptr))))
-(define (render-copy renderer texture srcrect dstrect)
+(define* (render-copy renderer texture #:key srcrect dstrect)
"Copy TEXTURE to the rendering target of RENDERER."
(let ((result (ffi:sdl-render-copy (unwrap-renderer renderer)
(unwrap-texture texture)
- (if (nil? srcrect)
- %null-pointer
- (make-c-struct ffi:sdl-rect srcrect))
- (if (nil? dstrect)
- %null-pointer
- (make-c-struct ffi:sdl-rect dstrect)))))
+ (if srcrect
+ (make-c-struct ffi:sdl-rect srcrect)
+ %null-pointer)
+ (if dstrect
+ (make-c-struct ffi:sdl-rect dstrect)
+ %null-pointer))))
(unless (zero? result)
(sdl-error "render-copy" "failed to copy texture"))))