summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-12-05 12:49:50 -0500
committerDavid Thompson <dthompson2@worcester.edu>2020-12-05 12:52:11 -0500
commit5d313ab4e8584c1d9dbfccf5c69bc48a43ee37c8 (patch)
tree9c0655e7c37bc188902d2395fe89af0f133644dc
parentf68b22ee64a737b121d5f4eb306175a3a53341bf (diff)
video: Change window size/position procedures to return multiple values.
-rw-r--r--doc/api.texi17
-rw-r--r--sdl2/video.scm3
2 files changed, 9 insertions, 11 deletions
diff --git a/doc/api.texi b/doc/api.texi
index f72178b..2ce58b9 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -93,25 +93,22 @@ Return the title for @var{window}.
@end deffn
@deffn {Procedure} window-size window
-Return the dimensions of @var{window}.
+Return 2 values for the dimensions of @var{window}.
@end deffn
@deffn {Procedure} window-minimum-size window
-Return the minimal dimensions, that @var{window} should take.
-Note, that SDL does not always enforce this restriction, so you might end up
-with a window-size, that is actually smaller than the value returned by this
-function.
+Return 2 values for the minimal dimensions that @var{window} can be.
+Note that SDL does not always enforce this restriction, so you might
+end up with a window size that is actually smaller than the value
+returned by this procedure.
@end deffn
@deffn {Procedure} window-maximum-size window
-Return the maximal dimensions, that @var{window} should take.
-Note, that SDL does not always enforce this restriction, so you might end up
-with a window-size, that is actually larger than the value returned by this
-function.
+Return 2 values for the maximum dimensions that @var{window} can be.
@end deffn
@deffn {Procedure} window-position window
-Return the position of @var{window} on the display.
+Return 2 values for the position of @var{window} on the display.
@end deffn
@deffn {Procedure} window-id window
diff --git a/sdl2/video.scm b/sdl2/video.scm
index dda917a..a9e44db 100644
--- a/sdl2/video.scm
+++ b/sdl2/video.scm
@@ -160,7 +160,8 @@ returns or otherwise exits."
(proc (unwrap-window window)
(bytevector->pointer bv)
(bytevector->pointer bv (sizeof int)))
- (bytevector->sint-list bv (native-endianness) (sizeof int))))
+ (values (bytevector-sint-ref bv 0 (native-endianness) (sizeof int))
+ (bytevector-sint-ref bv (sizeof int) (native-endianness) (sizeof int)))))
(define (window-size window)
"Return the dimensions of WINDOW."