Hi, dusoft.
Thanks for the response, but I think I didn't describe the issue well.
Once the resize operation is
done and the mouse button is released, I have no problems dealing with it. As you mentioned, love.resize passes that information on the program, and I can perform any adjustments I need so love.paint works with the new window size.
The "problem" is that
while the drag operation is going on during the window resizing, there's no love.resize messages being sent, and there's no love.draw operation happening. That only happens on the mouse release of the resize operation. So any areas that are exposed
during the drag are painted black.
If I do something like:
Code: Select all
function love.resize()
print("resizing")
io.flush()
end
It won't print any events while it's resizing, so that verifies that it only triggers once the window is resized.
Similarly, if I try:
Code: Select all
local count = 1
function love.draw()
-- set window background color
love.graphics.clear(GREY)
love.graphics.setColor(GREY)
love.graphics.rectangle("fill", 1, 1, 1000, 1000)
print("draw", count)
count = count + 1
io.flush()
end
The draw event stops triggering during the resize event.
It's as if the underlying toolkit stops processing messages
during the Windows resize event.
Google claims that LOVE2D uses the ANGLE library to handle graphics. But other programs that use ANGLE (for example, Godot) don't see to have this limitation. So I assume that it's
not a limitation of the graphics library.
I redefined love.run as:
Code: Select all
local c = 1
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
-- We don't want the first frame's dt to include time taken by love.load.
if love.timer then love.timer.step() end
local dt = 0
-- Main loop time.
return function()
c = c + 1
print("run", c)
io.flush()
...
And it looks like
run doesn't trigger during the window drag, either. So there doesn't seem to be any obvious way to force Love2D to trigger an event during a resize.
Is there some way to make Love2D repaint while a resize drag is happening?