// the header file declares the variables
extern IrrlichtDevice *MainDevice; //The Main Irrlicht Device
extern ISceneManager *Scene; //Scene Manager
extern IVideoDriver *Driver; //Video Driver
extern IGUIEnvironment *GUI; //GUI Environment
extern ITexture *BGTex;
// the source file defines the variables
IrrlichtDevice *MainDevice = 0;
ISceneManager *Scene = 0;
IVideoDriver *Driver = 0;
IGUIEnvironment *GUI = 0;
ITexture *BGTex = 0;
// the initialization routine initializes the variables
void initSystems()
{
IEventReceiver* eventReceiver = new EventReceiver;
MainDevice= createDevice(EDT_DIRECT3D9, dimension2d<s32>(800, 600), 16, false, true, false, eventReceiver);
Scene = MainDevice->getSceneManager();
Driver = MainDevice->getVideoDriver();
GUI = MainDevice->getGUIEnvironment();
}
void initMenu()
{
// ...
BGTex = Driver->getTexture("2D Images/Menu/BG.bmp");
// ...
}
vitek wrote:It appears that the problem you have is that you have declared a global and a local variable with the same name. When you initialize the local variable, it has no effect on the global. At some time later in your program, you access the global, but it was never initialized.
0xC0000005: Access violation reading location 0x00000001Users browsing this forum: Google [Bot] and 1 guest