Page 2 of 2

Re: Strange limit to mouse.getX-getY

Posted: Mon Jan 31, 2011 5:07 pm
by vrld
What if you set the window size in love.conf?

Re: Strange limit to mouse.getX-getY

Posted: Mon Jan 31, 2011 8:09 pm
by gerard
vrld wrote:What if you set the window size in love.conf?

That worked. I cannot use love.graphics.setMode, because the problem appears again, but at least I can start the game in the resolution I want.

Thanks. :ultraglee:

Re: Strange limit to mouse.getX-getY

Posted: Sat Feb 05, 2011 2:05 am
by miko
gerard wrote:As it seems to be a problem with my installation of love, I will try to reinstall it to see if that eliminates the problem.
Its not, I can confirm this with my setup (linux/love 0.7.0).
love always sets the 800x600 mode first, and then changes it with another setMode:

Code: Select all

$ ltrace  love . 2>&1 |grep VideoMode
SDL_VideoModeOK(800, 600, 32, 2, 0xb76d41c0)     = 32
SDL_SetVideoMode(800, 600, 32, 2, 0xbfbe12c0)    = 0x8e839d0
SDL_SetVideoMode(1280, 720, 32, 2, 0xb76db8a0)   = 0x8e839d0
BTW, the problem goes away if you set fullscreen mode to true.

Now that I tried it a few more times, the original code also works OK (with fullscreen=false). So it looks like the underlying SDL problem. Is it possible that calling SDL_SetVideoMode more than once is not defined for SDL?

SDL docs says:

Code: Select all

SDL_RESIZABLE
Create a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL_SetVideoMode can be called again with the new size.
So I guess that you need to pass SDL_RESIZABLE in the first call if you want to resize the window later with another SetVideoMode. Or love should generate SDL_VIDEORESIZE event after each resize (setMode with different W/H values). Or, if changing resolution on-the-fly is not supported within love (which should be documented), it should call SDL_SetVideoMode only once (doing "lazy initialization" after love.load() ).
Check this out: http://www.libsdl.org/docs/html/sdlresizeevent.html

Re: Strange limit to mouse.getX-getY

Posted: Sat Feb 05, 2011 10:57 am
by bartbes
The creation of two windows is simply because it is told to do so, if you want to set the resolution of the first window it creates use the config file.

Re: Strange limit to mouse.getX-getY

Posted: Sat Feb 05, 2011 11:08 am
by vrld
miko wrote:So I guess that you need to pass SDL_RESIZABLE in the first call if you want to resize the window later with another SetVideoMode.
Resizable simply means that the user is able to change the window size. If that happens, the SDL_ResizeEvent tells how big the new window is, so you can draw accordingly.
SDL_SetVideoMode is for when you - the programmer - want to change the window size.

Anyway, this bug is (hopefully) fixed in the next release.