开发者

Error calling C++/CLI constructor from C#

I am trying to save and restore state by using a StateBlock in SlimDX via the following snippet:

StateBlockMask mask = new StateBlockMask(null) { RasterizerState = true };
var sb = new StateBlock(device.Device, mask);

Both StateBlockMask and StateBlock are classes. This gives me a compilation error:

'.ctor' is not supported by the language

Reading from some other posts here on SO, it seems that this is a problem that has to do with calling the managed code with the wrong arguments. In the source of SlimDX, I find:

StateBlock::StateBlock(SlimDX::Direct3D10::Device^ device, StateBlockMask mask)

I have no experience at all with C++/CLI, so I am wondering if there is something wrong here (like a missing or extra ^), or should I concentrate of faults on my side?

(NOTE: This question has been cross-posted to gamedev.net, futur开发者_如何学运维e users with the same question may also want to check for answers given there)


Is StateBlockMask a struct? If not, use StateBlockMask^ mask in the C++ constructor.


This looks like a bug in SlimDX. You might want to use the issue tracker to make sure it gets dealt with properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜