mandee.cabato.ph Posted May 4, 2012 Share Posted May 4, 2012 Is there any way to keep the game running in the background while the user is focused elsewhere? Link to comment
mandee.cabato.ph Posted May 4, 2012 Author Share Posted May 4, 2012 We were not able to get engine.app.setUpdate(1) to do this for us. What could we be missing here? Link to comment
mandee.cabato.ph Posted May 4, 2012 Author Share Posted May 4, 2012 One of my teammates got it working by calling engine.app.setUpdate(1) in the last portion of the world init(): int init () { //calls here //calls here engine.app.setUpdate(1); } However, this is not the case for me, it only works if I call the function in the word update(). It seems that engine.app.setUpdate() is called elsewhere but nowhere in the scripts that we wrote. Link to comment
ulf.schroeter Posted May 4, 2012 Share Posted May 4, 2012 This problem seems to be related to machine HW/OS/SW. In our case calling engine.app.setUpdate(1) on a machine with Windows7 and NVIDIA 3000M works (rendering continues even when Unigne window looses focus), while identical code on machine with WindowsXP and Intel GPU does not (rendering stops when Unigine window looses focus) [Edit] Was just a sympton due to different editor settings between machines. Real cause see below Link to comment
manguste Posted May 8, 2012 Share Posted May 8, 2012 Ok, we'll try to reproduce it (no WndowsXP+Intel GPU, unfortunately). Redirected to QA. Link to comment
ulf.schroeter Posted May 10, 2012 Share Posted May 10, 2012 The problem might be related to UNIGINE editor overwrite of previous engine.app.setUpdate() calls from world script init() function without saving this state in core/editor.editor.cpp .... int update() { int need_reload = engine.editor.needReload(); engine.app.setUpdate(toolsGetAlwaysUpdate()); .... If "Always update" in editor is disabled this will stop background update even when editor is closed again due to missing restore of update state on editor invocation. 1 Link to comment
mandee.cabato.ph Posted May 16, 2012 Author Share Posted May 16, 2012 Thanks. That finally solved the issue. Link to comment
Recommended Posts