You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I am trying to implement custom include handler for D3DCompiler.
In C++ there is ID3DInclude which developer could inherit from and then override methods, but here in C# there is no such possibility because of how structs work in C#.
So, my question is - how to implement custom include handler in Silk.Net?
The text was updated successfully, but these errors were encountered:
You don't need to implement your own handler if all you need is just a simple include behavior, just pass (ID3DInclude*)1 as value for pInclude argument in Compile/Compile2.
If you need more elaborate handler logic you can use this:
static unsafe int Open(ID3DInclude* include, D3DIncludeType IncludeType, byte* pFileName, void* pParentData, void** ppData, uint* pBytes)
{
// Your implementation here
}
static unsafe int Close(ID3DInclude* include, void* pData)
{
// Your implementation here
}
var lpVtbl = stackalloc void*[2];
delegate*<ID3DInclude*, D3DIncludeType, byte*, void*, void**, uint*, int> d0 = &Open;
lpVtbl[0] = d0;
delegate*<ID3DInclude*, void*, int> d1 = &Close;
lpVtbl[1] = d1;
var include = new ID3DInclude(lpVtbl);
Hi. I am trying to implement custom include handler for D3DCompiler.
In C++ there is ID3DInclude which developer could inherit from and then override methods, but here in C# there is no such possibility because of how structs work in C#.
So, my question is - how to implement custom include handler in Silk.Net?
The text was updated successfully, but these errors were encountered: