Page 1 of 1

using a XML file to handle configuration?

Posted: Wed Apr 27, 2005 3:15 pm
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

Posted: Wed Apr 27, 2005 3:29 pm
by fatcat46
i Think you can use tinyXML, i will use in my project.

Posted: Wed Apr 27, 2005 5:35 pm
by Guest
a null device?

Posted: Wed Apr 27, 2005 8:06 pm
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.

Posted: Thu Apr 28, 2005 3:04 pm
by Alex001
for this case I recommend to just use a simple config reader -
therefore you can find several examles in the net