Well I’ve made progress with my collada loader, using irrXML (which is by far the best and simplest SAX-style XML parser I’ve found). I have loaded in all object geometries and submeshes and reformatted them into DX data structures. What my loader will do is parse a collada file and return a struct for each object defined in the file, the struct will contain an input layout, vertex/index/attribute buffers ready for use.
Now I’m having a fair amount of issues with the irrXML library tho, firstly I’ve found a few bugs, it has no method of error checking whether a file exists or not, the documentation states that upon failure to open the file the create method will return null, but it doesn’t do that, it creates the irrXML reader anyways whether the file exists or not. If you try call the read() function then that fails, so I can hack in a basic file check that way or do a separate fopen() check prior to creating the irrXML object. Both methods are just ugly hacks (and I cant check whether the file exists or if its simply empty with the first method).
Then the parser itself has a pretty quirky behavior wherein it reads tabs and whitespace as nodes. For example with this test XML file:
You would expect the parser to read only three nodes? Unfortunately it doesn’t, it treats tabs and whitespace as elements. So the following occurs: Read more of this post