Any suggestion for my XML configure file?

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
Yusaku
Posts: 8
Joined: Sun Jun 10, 2007 3:43 am

Any suggestion for my XML configure file?

Post by Yusaku »

I began to use Irrlicht for my game and tried to use XML as my config file (which contains window width, height info), however, I found it seems like only AFTER we create a device, we could use "createXMLReader".

So my problem is: without window width and height info from XML file, I can't create device, however, without the device I couldn't read XML...

Any suggestion for this situation? I really don't want to also integrate any library like tinyXML to my system...

Thx a lot!
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

How about not using XML for your config. ini file style is very easy to parse and doesn't need a complex parser like XML does. Also ino style is easier to read than XML for a human user too. I don't see a feature in favor of XML in this context.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

I had this problem too.

And there is only 2 solutions I found:
- create NULL video device (you will not have ability to render, but device will be valid pointer and you will be able to createXMLReader);
- especially for this kind of config (that is needed before device creation) -- do not use XML but some simple own text or binary format.

I choose second way, because only the idea of recreating device for such simple thing kills my mind :)

P.S.: but all other data (like scene configuration etc.) I storing in XML.
mispunt
Posts: 15
Joined: Fri Jan 07, 2005 6:01 pm

Post by mispunt »

or use another XML parser (TinyXML perhaps ;))
LLDD
Posts: 43
Joined: Fri May 11, 2007 9:50 am

Post by LLDD »

Use irrXML so you can get an xml reader before the device creation.
________
CHEVROLET STRAIGHT-6 ENGINE SPECIFICATIONS
Last edited by LLDD on Sun Feb 20, 2011 7:49 am, edited 1 time in total.
Yusaku
Posts: 8
Joined: Sun Jun 10, 2007 3:43 am

Post by Yusaku »

Thx guys! Since I should finished the other parts of my program, just leave configure problem at this stage... anyway, thx for all ur suggestions!

I'm thinking... probably it's not a good idea to tightly integrate everything in the core of engine? (like this case, we need a "device" to read file, but some data for creating a device is inside the file -_-#) In my own engine (it's just a wapper of Irrlicht now and I'm planning to build up a REAL engine for crossplatform mobile games), I will have 3 parts: render system, file system, sound system and hopefully it could be easily to fix into any kind of games...
Post Reply