summaryrefslogtreecommitdiff
path: root/sdl2/rect.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-12-05 13:12:14 -0500
committerDavid Thompson <dthompson2@worcester.edu>2020-12-05 13:12:14 -0500
commitadaeccde0643649225a26044d9a588e49d403d85 (patch)
tree6835a715fd7d0d8cf99fc28c3d0305bcd0659ea8 /sdl2/rect.scm
parent1bad7879529103b97608cfdf3757ba5cd1186b61 (diff)
rect: Add setters.
Diffstat (limited to 'sdl2/rect.scm')
-rw-r--r--sdl2/rect.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/sdl2/rect.scm b/sdl2/rect.scm
index 1fd3af9..8ec3cfa 100644
--- a/sdl2/rect.scm
+++ b/sdl2/rect.scm
@@ -33,7 +33,11 @@
rect-x
rect-y
rect-width
- rect-height))
+ rect-height
+ set-rect-x!
+ set-rect-y!
+ set-rect-width!
+ set-rect-height!))
(define-record-type <rect>
(%make-rect bv ptr)
@@ -56,3 +60,15 @@
(define-inlinable (rect-height rect)
(s32vector-ref (rect-bv rect) 3))
+
+(define-inlinable (set-rect-x! rect x)
+ (s32vector-set! (rect-bv rect) 0 x))
+
+(define-inlinable (set-rect-y! rect y)
+ (s32vector-set! (rect-bv rect) 1 y))
+
+(define-inlinable (set-rect-width! rect w)
+ (s32vector-set! (rect-bv rect) 2 w))
+
+(define-inlinable (set-rect-height! rect h)
+ (s32vector-set! (rect-bv rect) 3 h))