Skip to content

sdl:video-dimensions returns NIL if no window exists #62

Description

@robotjunkyard

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions