Archived

This topic is now archived and is closed to further replies.

saving to xfile

This topic is 4945 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I''m trying to save to an xfile using IDIRECTXFILE API. So far I can get an xfile to be made but I don''t know what needs to be done next. CreateSaveObject has a SaveTemplate() function, but that doesn''t seem to work. Any help? Thanks

Share this post


Link to post
Share on other sites
It is a bit complex, bassically call DirectXFileCreate then RegisterTemplates - if you are not using your onw the call is:

xFile->RegisterTemplates((LPVOID)D3DRM_XTEMPLATES,D3DRM_XTEMPLATE_BYTES);

Then you need to create the save object that you write to by calling CreateSaveObject

You then create your heirarchy of mesh objects. Call CreateDataObject for each item (mesh, frame, transform etc.)

As I said its a bit complex but if you look in the help for each of those functions above you should be able to work it out, if not I may be able to post more code

Share this post


Link to post
Share on other sites
Yeah that worked!! cool. D3DRM_XTEMPLATES was the bit I was missing.
No doubt I will still have to work on it a lot more.
Do you know if you have to have the templates in the file as well? I have done that with SaveTemplates(), but I don''t know if it''s neccarsary? Also I read some where that you can have your own header in there as well, do you know how to do that?
Thanks.

Share this post


Link to post
Share on other sites