How to solved error
Unable to cast object of type ‘System.Int32’ to type ‘Microsoft.DirectX.Direct3D.VertexShader’
We want to case ”System.Int32′ value into ‘Microsoft.DirectX.Direct3D.VertexShader’
I tried with CType but not working.
Also tried
mD3DDevice.VertexShader = CObj(D3DFVF_CUSTOMVERTEX_BOX)
but no luck
Can you please help
The
Microsoft.DirectX.Direct3D.VertexShaderis a class, a reference-type, not a value type. You cannot directly convert aSystem.Int32to aVertexShader, asVertexShaderisn’t based onSystem.Int32and there is no predefined conversion.If you can think of a legitimate way to convert a
System.Int32to aVertexShader, you can implement the conversion yourself.Otherwise, it seems you should either:
documentation, and specifically
its constructors documentation.
Device.GetVertexShaderInt32Constant
and
Device.SetVertexShaderConstantInt32
methods.