Game frozen while moving window?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Kelox
Prole
Posts: 2
Joined: Sun Feb 10, 2019 2:00 pm

Game frozen while moving window?

Post by Kelox »

Hey, im currently trying to make a server console with love, but my problem is that while im moving the window the "game" freezes and wont receive any client messages until I let the window go.

Is there a way to keep running code even while Im moving the window? Couldnt find any solution on google/wiki
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: Game frozen while moving window?

Post by keharriso »

I'm not sure what your code is doing, but this extremely simple example shows that the game should keep running (both drawing and updating) while the window is in motion:

Code: Select all

local t = 0

function love.update(dt)
	t = t + dt
	print(t)
end

function love.draw()
	love.graphics.print(t)
end
Care to share your runnable code?
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: Game frozen while moving window?

Post by pgimeno »

I believe that's OS-dependent.
User avatar
keharriso
Party member
Posts: 109
Joined: Fri Nov 16, 2012 9:34 pm

Re: Game frozen while moving window?

Post by keharriso »

pgimeno wrote: Thu Feb 28, 2019 10:17 pm I believe that's OS-dependent.
Absolutely correct. Works on Linux, doesn't work on Windows.

On the plus side, it looks like the updating is happening... just the drawing is delayed.
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Game frozen while moving window?

Post by zorg »

keharriso wrote: Thu Feb 28, 2019 11:21 pm On the plus side, it looks like the updating is happening... just the drawing is delayed.
I think that the whole main thread gets blocked, meaning unless you do all your logic in a different thread, even that will be blocked.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Kelox
Prole
Posts: 2
Joined: Sun Feb 10, 2019 2:00 pm

Re: Game frozen while moving window?

Post by Kelox »

keharriso wrote: Thu Feb 28, 2019 11:21 pm
pgimeno wrote: Thu Feb 28, 2019 10:17 pm I believe that's OS-dependent.
Absolutely correct. Works on Linux, doesn't work on Windows.

On the plus side, it looks like the updating is happening... just the drawing is delayed.
Sadly update isnt working while moving the window either. Just looks like it is since youre adding deltaTime after you let go :(

zorg wrote: Fri Mar 01, 2019 3:09 am
keharriso wrote: Thu Feb 28, 2019 11:21 pm On the plus side, it looks like the updating is happening... just the drawing is delayed.
I think that the whole main thread gets blocked, meaning unless you do all your logic in a different thread, even that will be blocked.
Will try doing that, thank you =)
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Game frozen while moving window?

Post by zorg »

Kelox wrote: Fri Mar 01, 2019 11:49 am
zorg wrote: Fri Mar 01, 2019 3:09 am
keharriso wrote: Thu Feb 28, 2019 11:21 pm On the plus side, it looks like the updating is happening... just the drawing is delayed.
I think that the whole main thread gets blocked, meaning unless you do all your logic in a different thread, even that will be blocked.
Will try doing that, thank you =)
You're welcome, but a few things:
- (Rendering) Graphics only work on the main thread,
- the love.event.pump method also only works on the main thread (called automatically by love.run)

In short, this means:
- Inputs won't get registered while you're dragging the window even if you moved all event processing to another thread, since pump needs to be on the main one.
- Nor will anything be painted onto the window itself for the first reason.

Now, you can still calculate tons of stuff which won't be blocked indeed, but... without input or visual feedback, it might be worse to implement that than have everything pause for the duration of the drag.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests