Jump to content

[SOLVED] Run Game in Background


photo

Recommended Posts

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

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

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.

 

post-82-0-72510600-1336674037_thumb.jpg

  • Like 1
Link to comment
×
×
  • Create New...