Fullscreen window, hide/show mouse cursor position
Posted: Tue Sep 20, 2011 1:02 am
Hey guys,
So I've been testing out fullscreen mode in my game recently, and while I use the default pointer everything works fine. However hiding and showing the mouse cursor in fullscreen mode seems to alter the mouse's position. I can work around this, I think, but it's really quite annoying and unexpected. In windowed mode this never happens. I'm wondering if this is something wrong in SDL and if something in Love can be done to stop it?
Thanks guys.
Example code:
Move the mouse around to see its position getting changed as cursor visibility is changed, if you set the fullscreen flag to false this doesn't happen. Clicking exits.
So I've been testing out fullscreen mode in my game recently, and while I use the default pointer everything works fine. However hiding and showing the mouse cursor in fullscreen mode seems to alter the mouse's position. I can work around this, I think, but it's really quite annoying and unexpected. In windowed mode this never happens. I'm wondering if this is something wrong in SDL and if something in Love can be done to stop it?
Thanks guys.
Example code:
Move the mouse around to see its position getting changed as cursor visibility is changed, if you set the fullscreen flag to false this doesn't happen. Clicking exits.
Code: Select all
local fullscreen = true
function love.load()
love.graphics.setMode(1680, 1050, fullscreen, false, nil)
end
local count = 0
local cursor = false
function love.update(dt)
count = count + dt
if count > 1.5 then
count = 0
love.mouse.setVisible(cursor)
cursor = not cursor
end
end
function love.draw()
love.graphics.rectangle('fill', love.mouse.getX(), love.mouse.getY(), 10, 10)
end
function love.mousepressed()
love.event.push("q")
end