Lispbuilder's documentation states that, if SDL:WINDOW has not yet been called, then SDL:VIDEO-DIMENSIONS returns "the best video dimensions" (presumably this means the native desktop resolution, which is the intent). However it returns NIL if this is the case:
(sdl:with-init ()
(let ((best-res (sdl:video-dimensions)))
(format t "best-res = ~a~%" best-res)
(setq *monitor-res-x* (aref best-res 0)
*monitor-res-y* (aref best-res 1)))
[et cetera...]
And of course it crashes on aref because best-res was returned as NIL.
It does returns a 2-element vector just fine if a WINDOW was already made, but in this instance I want it to memorize the native desktop resolution before my program makes any windows.
Lispbuilder's documentation states that, if SDL:WINDOW has not yet been called, then SDL:VIDEO-DIMENSIONS returns "the best video dimensions" (presumably this means the native desktop resolution, which is the intent). However it returns NIL if this is the case:
And of course it crashes on aref because best-res was returned as NIL.
It does returns a 2-element vector just fine if a WINDOW was already made, but in this instance I want it to memorize the native desktop resolution before my program makes any windows.