I've noticed that there is a small delay between when the actual mouse moves and when I draw my custom mouse. I draw it as just an image using the mouse.getPosition() coordinates to find out where to put it, but it always seems to be just a split second behind. It is noticeable.
It seems to be an issue with how love gets the mouse position, presumably only once every iteration of the game loop. But by the time it is displayed on the screen, the mouse has already moved to a different position.
I was wondering if there was a solution or some kind of work-around. Any help is greatly appreciated.
Mouse delay?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Mouse delay?
Maybe take the mouse positioning code out of the game loop and have it at the start of the update function?
wat ya mean she's in another castle!?
Re: Mouse delay?
You may or may not want to turn vsync off using love.graphics.setMode or conf.lua (discussed further here: viewtopic.php?f=4&t=9098)
Re: Mouse delay?
Amazing, it works. The delay is gone.Santos wrote:You may or may not want to turn vsync off using love.graphics.setMode or conf.lua (discussed further here: viewtopic.php?f=4&t=9098)
But I noticed that the fps shot up to like 500.
Are there any reasons why I would want to leave vsync on? Does a game require more CPU with it off? Should I try to reduce the update rate (have a check and update only 60 times a second) to compensate for the high frame rate? Lol, lots of questions, sorry.

Thanks for the help.

Re: Mouse delay?
I'm glad I could help! 
It's there to prevent screen tearing.
I have no idea about CPU usage sorry.
Using dt properly inside love.update means the framerate won't affect the speed of things in game.

It's there to prevent screen tearing.
I have no idea about CPU usage sorry.

Using dt properly inside love.update means the framerate won't affect the speed of things in game.
Re: Mouse delay?
Maybe I'll play with it to see if there's any negative effects. Now that I know what I can do about it, I might be able to come up with some work-around if I do see some problems.Santos wrote:I'm glad I could help!
It's there to prevent screen tearing.
I have no idea about CPU usage sorry.
Using dt properly inside love.update means the framerate won't affect the speed of things in game.
Thanks!
Re: Mouse delay?
If the video drivers are good, playing with vsync on is faster than playing without it (it depends on the framerate difference). If the video drivers are bad, it's slow in both cases.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Mouse delay?
The next time you have problems, please check the forums.
Here is another thread on the subject: viewtopic.php?f=4&t=2780
Here is another thread on the subject: viewtopic.php?f=4&t=2780
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
- dreadkillz
- Party member
- Posts: 223
- Joined: Sun Mar 04, 2012 2:04 pm
- Location: USA
Re: Mouse delay?
This is a well known issue in video games, especially if you've played counter strike or any shooters a lot in the past. Vsync is just nasty cause it's artifically delaying frames to sync with your refresh rate, so it looks like your video is lagging. (at least that's how I recall researching this many many years ago).
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mouse delay?
It's awesome! It prevents screen tear, it prevents me from having more fps than I'll ever need (because my monitor wouldn't be able to display it), and it's nice on my cpu too (YMMV). That said, for really responsive controls you'll need to have it off, in general though, it's good enough with it on.dreadkillz wrote:Vsync is just nasty cause it's artifically delaying frames to sync with your refresh rate
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 7 guests