using a XML file to handle configuration?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
markus
Posts: 23
Joined: Tue Mar 01, 2005 9:01 pm
Location: Germany

using a XML file to handle configuration?

Post by markus »

Hi,
i want to have the device init params saved in a XML file.

Code: Select all

Device = createDevice(driverType, dimension2d<s32>(800, 600),
		32, true, true, false, &receiver);
so i don't need to recompile when i want to change the resolution or windowed vs full screen mode etc.
Since the integrated XML parser does need a device already created:

Code: Select all

io::IXMLReader* xml = Device->getFileSystem()->createXMLReader(
		configfile.c_str() );
i am a little helpless now.

So how am i able to acces the xml parser without having created a device?

Greetings
Markus
fatcat46
Posts: 23
Joined: Fri Apr 22, 2005 10:34 pm
Contact:

Post by fatcat46 »

i Think you can use tinyXML, i will use in my project.
:: Double K ::
Web Site Under Construction
(http://k.domaindlx.com/fatcat46)
Guest

Post by Guest »

a null device?
djceejay
Posts: 41
Joined: Fri Feb 25, 2005 11:42 am

Post by djceejay »

You could pass the ones you need before createDevice as paramters to the program ( int main(int argv,char ** args) ). Then for all the other parameters use an XML file.
Or if you can resize the window, load the program with default values, load the XML file (you have a device now), then change the window size.
djceejay
Studying :: BSc Computer Games Technology :: UK
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

Post by Alex001 »

for this case I recommend to just use a simple config reader -
therefore you can find several examles in the net
Any fool can make things bigger, more complex, and more violent. It takes a touch of genius-and a lot of courage-to move in the opposite direction.
(Albert Einstein)
Post Reply