Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EffectParameter()

unsafe Microsoft.Xna.Framework.Graphics.EffectParameter.EffectParameter ( ID3DXBaseEffect * parent,
Effect effect,
sbyte * handle,
int index )
inlinepackage

Definition at line 57 of file EffectParameter.cs.

58 {
59 _parent = effect;
60 pEffect = parent;
62 _index = index;
63 base._002Ector();
64 ID3DXBaseEffect* ptr = pEffect;
65 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
66 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
67 if (num < 0)
68 {
69 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
70 }
71 IntPtr ptr2 = (IntPtr)(void*)(int)(*(uint*)(&d3DXPARAMETER_DESC));
73 _semantic = ((System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 4)) == 0) ? string.Empty : Marshal.PtrToStringAnsi((IntPtr)(void*)(int)System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, uint>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 4))));
74 _rows = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 16));
75 _columns = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 20));
76 _paramClass = _003CModule_003E.ConvertDxParameterClassToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, _D3DXPARAMETER_CLASS>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 8)));
77 _paramType = _003CModule_003E.ConvertDxParameterTypeToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, _D3DXPARAMETER_TYPE>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 12)));
78 pAnnotations = new EffectAnnotationCollection(pEffect, _handle, System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 28)));
79 uint count = ((System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 24)) == 0) ? System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, uint>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 32)) : 0u);
80 pParamCollection = new EffectParameterCollection(parent, effect, _handle, (int)count, arrayElements: false);
81 pElementCollection = new EffectParameterCollection(parent, effect, _handle, System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 24)), arrayElements: true);
82 }
static unsafe? string PtrToStringAnsi(IntPtr ptr)
Definition Marshal.cs:630

References Microsoft.Xna.Framework.Graphics.EffectParameter._columns, Microsoft.Xna.Framework.Graphics.EffectParameter._handle, Microsoft.Xna.Framework.Graphics.EffectParameter._index, Microsoft.Xna.Framework.Graphics.EffectParameter._name, Microsoft.Xna.Framework.Graphics.EffectParameter._paramClass, Microsoft.Xna.Framework.Graphics.EffectParameter._paramType, Microsoft.Xna.Framework.Graphics.EffectParameter._parent, Microsoft.Xna.Framework.Graphics.EffectParameter._rows, Microsoft.Xna.Framework.Graphics.EffectParameter._semantic, System.count, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), System.handle, System.index, Microsoft.Xna.Framework.Graphics.EffectParameter.pAnnotations, Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, Microsoft.Xna.Framework.Graphics.EffectParameter.pElementCollection, Microsoft.Xna.Framework.Graphics.EffectParameter.pParamCollection, and System.Runtime.InteropServices.Marshal.PtrToStringAnsi().