edgar-mtz-e / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

pls add this for XFile default templates #423

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
MDX had this ability to load the default XFile templates:

#include <rmxftmpl.h>
void XFile::RegisterDefaultTemplates()
{
    HRESULT hr = InternalPointer->RegisterTemplates(D3DRM_XTEMPLATES,
D3DRM_XTEMPLATE_BYTES);
    if( RECORD_D3D9(hr).IsFailure )
        throw gcnew Direct3D9Exception( Result::Last );

    hr = InternalPointer->RegisterTemplates(XSKINEXP_TEMPLATES,
sizeof(XSKINEXP_TEMPLATES) - 1); // not sure why the example had -1 here
    if( RECORD_D3D9(hr).IsFailure )
        throw gcnew Direct3D9Exception( Result::Last );
}

Original issue reported on code.google.com by countpri...@gmail.com on 30 Jan 2009 at 6:19

GoogleCodeExporter commented 9 years ago
okay I do understand the "-1". It's the null terminator on the the string.

Original comment by countpri...@gmail.com on 30 Jan 2009 at 6:34

GoogleCodeExporter commented 9 years ago
I suppose we should load the XEXTENSIONS_TEMPLATES as well as these other two. 
And
strlen would probably make more sense then sizeof()-1.

Original comment by countpri...@gmail.com on 30 Jan 2009 at 6:37

GoogleCodeExporter commented 9 years ago
Enjoy, Mike!

Original comment by promit....@gmail.com on 1 Feb 2009 at 8:16

GoogleCodeExporter commented 9 years ago
So would it be right to have three different methods -- one for each of these
template collections? Or just put all three in the same method?

Original comment by countpri...@gmail.com on 1 Mar 2009 at 5:31

GoogleCodeExporter commented 9 years ago
I made them static properties of the XFile class.

Fixed in r937.

Original comment by Mike.Popoloski on 5 Mar 2009 at 5:19