Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
robotjunkyard opened this issue Jul 4, 2017 · 1 comment
Open

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

robotjunkyard opened this issue Jul 4, 2017 · 1 comment
Assignees
Labels

Comments

@robotjunkyard
Copy link

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.

@Balooga
Copy link
Contributor

Balooga commented Sep 9, 2018

For some reason SDL_GetVideoInfo is returning a null pointer, which is why (sdl:video-dimensions) returns nil. I need to do some digging to find out why SDL is suddenly behaving like this. I know for sure this used to work.

@Balooga Balooga self-assigned this Sep 9, 2018
@Balooga Balooga added the bug label Sep 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants