From 5d313ab4e8584c1d9dbfccf5c69bc48a43ee37c8 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 5 Dec 2020 12:49:50 -0500 Subject: video: Change window size/position procedures to return multiple values. --- doc/api.texi | 17 +++++++---------- sdl2/video.scm | 3 ++- 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." -- cgit v1.2.3