CuteAlien wrote:Hm, that that operator should be set by the devices, shouldn't matter which driver is used.
I tried this morning with the device I'm using (EDT_OPENGL) and program crashed the same way.
A quick peek with the debugger showed me that the point of failure was inside Irrlicht code:
Code: Select all
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
{
#if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_)
MEMORYSTATUS MemoryStatus;
MemoryStatus.dwLength = sizeof(MEMORYSTATUS);
// cannot fail
GlobalMemoryStatus(&MemoryStatus);
if (Total)
*Total = (u32)(MemoryStatus.dwTotalPhys>>10); // Crash!
if (Avail)
*Avail = (u32)(MemoryStatus.dwAvailPhys>>10);
The file is COSOperator.cpp, line 179. It crashes exactly in the same point (tried both EDT_NULL and EDT_OPENGL: no differences)
You can try this code:
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
int main(int argc, char** argv)
{
u32 *TotMem;
u32 *AvailMem;
u32 *MHZ;
IrrlichtDevice* probe = createDevice(EDT_NULL);
IOSOperator *op = probe->getOSOperator();
op->getSystemMemory(TotMem, AvailMem);
op->getProcessorSpeedMHz(MHZ);
probe->closeDevice();
}
I'm on Win7 x64 SP1, processor AMD Phenom II, ram 8GB, ATI Radeon 5770.
I'm using Code::blocks 16.01 and TDM MINGW64 5.2.0 to compile both Irrlicht and my app.
(EDIT) the exact error given is segmentation fault (SIGSEGV). Right now I tried to call GlobalMemoryStatus directly:
Code: Select all
u32 *TotMem;
u32 *AvailMem;
MEMORYSTATUS MemoryStatus;
MemoryStatus.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&MemoryStatus);
*TotMem = (u32)(MemoryStatus.dwTotalPhys>>10); // Crash! Same error
*AvailMem = (u32)(MemoryStatus.dwAvailPhys>>10);
so I think it's not Irrlicht fault but something between MinGW and Windows...