Added sleep to irrlicht thread to allow user to adjust the performance of the irrlicht thread. It defaults to 65 ms. That seems to be the optimal number. Without sleep, the irrlicht thread would eat up 20-40% of the cpu time. When set to 65 ms, it only took up 2-4 % of cpu time with acceptable slowdown.
Code: Select all
[System::Runtime::InteropServices::DllImport("kernel32.dll")]
extern "C" void Sleep(long dwMilliseconds);
...
while(device->Run() && !bgwIrrlichtThread->CancellationPending)
{
...
// sleep (win32 unmanaged call)
Sleep(Convert::ToInt64(nudSleep->Text));
}
Update:
I've just uploaded the x64 version for everyone to download and play with (it uses 64-bit irrlicht and 64-bit irrlicht .NET dlls):
http://www.megaupload.com/?d=Z61T3V27
Nothing new since last post, I'm in a 64-bit craze at the moment so I just had to update irrShowMesh to x64 version.
Update 2:
Okay, looks like irrShowMesh is going to be the guinea pig to test out irrPreSettings. I have it setup to run irrPreSettings first. Once the user exits irrPreSettings, irrShowMesh will run and read in the xml file that irrPreSettings wrote.
irrShowMesh uses this to setup it's irrlicht device. Although, it doesn't use all of the items in the irrPreSetting xml file, it's useful nonetheless.
irrShowMesh has it's own configuration xml file for everything else like mesh settings (wireframe, initial position, etc.) that it saves so that the next time you run irrShowMesh it remembers the previous settings.
I couldn't figure out how to use the irrlicht's IXMLReader/Writer under irrlicht .NET. So, I used MS's xml api. It's quite similar to irrlicht's xml api in useage.
Anyway, I'll see if I can get a version ready for you guys to try out with the above mentioned additions.
Update 3:
Download here (still x64 version):
http://www.megaupload.com/?d=XHPW27A0