I'm having a problem with a certain line whenever I try to load a model.
scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh(filename);
If I have this line in main() it works. But if I for example put it in LoadModel() and call it from that exact same place, it gives me the System.NullReferenceException error.
I have Device declared as a global
IrrlichtDevice *Device = 0;
and then set it up at the beginning of main()
IrrlichtDevice *Device = createDevice(video::EDT_DIRECTX9,
core::dimension2d<s32>(1024, 768),
16, true, false, false, &receiver);
Does anyone know what could be happening? I've done this exact same thing in other programs without getting this problem.
WHY? Stupid problem... why is it doing this?
-
- Posts: 61
- Joined: Sun May 08, 2005 11:30 am
When you set your Device in Main with
IrrlichtDevice * Device ...
a new local Variable is being created which has nothing in commen with your global pointer (except for same variable types).
only use
Device = ...
IrrlichtDevice * Device ...
a new local Variable is being created which has nothing in commen with your global pointer (except for same variable types).
only use
Device = ...
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
under Devolpment, see http://yass-engine.de
-
- Posts: 61
- Joined: Sun May 08, 2005 11:30 am