Loading XML and createDevice
Loading XML and createDevice
I want to load a configuration file in XML which holds the width and height of the to create device. But for a XML reader to work, you need a device already. So I first create one, get the XML reader from it, drop it, and create a new device with the width and height from the XML reader. But, once you closeDevice() a device, the next device will always return false with .run()! So, how am I going to read a XML file with Irrlichts XML reader which holds information about the to create device? And why would .run() always return false if you dropped the first device, can't I just reinstanciate it?
well what I do is like this :
well the code works for me , dunno if its right way ..
jyon
Code: Select all
Device = createDevice(video::EDT_NULL);
FileManager = Device->getFileManager();
LoadConfig(); // do the xml stuff here
Device->drop(); // drop NULL device
Device = createDevice(deviceType,windowSize,bits,fullscreen,stensilbuffer,vsync);
// do what you wanna do here...
Device->drop();
jyon
but I thought the question was "how you get the XML reader working"eXodus wrote:I wouldn't say its the right way, but its how you do it with Irrlicht's XML reader.
all I meant was don't closeDevice() a device just drop() it
and createDevice() a device again with the info you loaded in XML config file.
then it wouldn't return false with .run()
jyon
lol eXodus, even using the NX verion is the wrong approach...
Why dont we use a (self-made or) build-in XML Reader within the application.. you guys wanna do everything with irrlicht, but loading the config settings for example would be better to load with a programmed class rather than setting up a fake-device to use its capability's...
When i started last year on my game in VB.Net there where no input\events for .NET, i had to program my own low-level hooks..
Why dont we use a (self-made or) build-in XML Reader within the application.. you guys wanna do everything with irrlicht, but loading the config settings for example would be better to load with a programmed class rather than setting up a fake-device to use its capability's...
When i started last year on my game in VB.Net there where no input\events for .NET, i had to program my own low-level hooks..
Current Project: Don Salvatore's Mafia
Genre: 3D Shooter \ RTS
Programming Language: VB .NET
Engine: Irrlicht 11 [.NET Wrapper]
Genre: 3D Shooter \ RTS
Programming Language: VB .NET
Engine: Irrlicht 11 [.NET Wrapper]