I am trying to integrate the new 4.2 commands setWindowSize() and toggleWindowMode() into my game, but while they work ok individually, when I try to switch to window mode with a specified window size, the size command gets ignored.
What I am doing is chaining the Lua calls, for example If I am fullscreen and I do:
toggleWindowMode()
setWindowSize({x=640,y=480})
I would expect the game to go into window mode, with a 640x480 window size.
What happens is that the player does go into widow mode, but the size command gets ignored.
I suspect it is because the size command gets executed while the window is still resizing, but I cannot find a way to make it work with Lua "callback style".
Any help would be really appreciated!