Resizing on Windows just freezes my app...I even tried to catch the change in window size manually in love.update() with no explicit resize callback involved but as long as the window the mouse button is held, all draw+game functions freeze on Windows 10. On Arch Linux it works just fine.
I looked it up in the wiki but the only thing tricky that's mentioned there was about fullscreen mode. I feel like i'm missing something, and appreciate every opinion you have on this. Thanks!
I have no os specific code i guess, so i feel like it's not about the code since it works fine with linux. I'll post my main.lua anyway...
Code: Select all
local display = Display:new()
local game = Game:new()
local resize
local scrolling
local scroll
function love.draw()
if resize then
love.graphics.setColor(0,0,0)
love.graphics.rectangle("fill",0,0,love.graphics.getWidth(),love.graphics.getHeight())
else
display()
end
end
function love.load()
local pos = game:start()
display:start(pos)
buffer = display.pMap()
display.pieces = new8x8(0)
scroll = scrollFunction(display.pieces,buffer,function(m,m2,s)
m[s.x][s.y] = m2[s.x][s.y]
return s
end)
scrolling = 0
end
function love.update(dt)
if resize then
resize = resize + dt
if resize > 0.5 then
resize = false
display:init()
end
end
if scrolling then
scrolling = scrolling + dt
if scrolling > 1/60 then
local s = scroll()
if s then
if display.float and s==display.float then
display.pieces[s.x][s.y]=0
end
scrolling = scrolling -1/60
else
scrolling = false
end
end
end
end
function love.resize()
resize=0
end