I'm stuck with a very weird problem that I just can't figure out.
When the Panda's render window loses focus (or get minimized) the CPU usage for that process jumps to 100% (while it's on focus, everything is perfect).
At the #panda3d channel, ThomasEgi suggested me to use the client-sleep (http://www.panda3d.org/manual/index.php/List_of_All_Config_Variables) on the Config.prc file. That was also pointed out by rdb here (http://www.panda3d.org/forums/viewtopic.php?t=10774) and discussed here (http://www.panda3d.org/forums/viewtopic.php?t=12744).
I assembled an absolute minimal test for it below. But it just don't work. When the window loses the focus the CPU usage jumps to 100%.
- Code: Select all
#include "pandaFramework.h"
#include "pandaSystem.h"
#include "load_prc_file.h"
PandaFramework myFramework;
WindowFramework *myWindow;
int main(int argc, char *argv[]) {
load_prc_file_data("","client-sleep 0.01");
myFramework.open_framework(argc, argv);
myWindow = myFramework.open_window();
myFramework.main_loop();
myFramework.close_framework();
return (0);
}
Can anyone spot anything there?
Anyone having the same issue?
Tyvm for any help or guidance.
EDIT: Solution: http://www.panda3d.org/forums/viewtopic.php?p=84916#84916
