But anyway, I want to be able to access code anywhere, like you would in a 'void' but for its insides to be applicable anywhere, for example;
The top part of my code (the rest of main is cut off)
Code: Select all
void setup()
{
IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(800, 600), 32, false, true, true, 0);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
}
int main()
{
setup();
//Load the quake 3 Map
//device->getFileSystem()->addZipFileArchive("media/map-20kdm2.pk3");
//Load the mesh inside the pk3 file
scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("room1.dmf");
scene::ISceneNode* q3node = 0;
It seems that the void is not letting smgr to be available to the rest of the code.