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

◆ SetValue() [11/18]

unsafe void Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue ( string value)
inline

Definition at line 176 of file EffectParameter.cs.

177 {
178 EffectParameterType paramType = _paramType;
179 if (paramType != EffectParameterType.String)
180 {
181 throw new InvalidCastException();
182 }
183 sbyte* ptr = (sbyte*)((!(value != null)) ? null : Marshal.StringToHGlobalAnsi(value).ToPointer());
184 ID3DXBaseEffect* ptr2 = pEffect;
185 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, sbyte*, int>)(int)(*(uint*)(*(int*)ptr2 + 200)))((nint)ptr2, _handle, ptr);
186 if (ptr != null)
187 {
189 }
190 if (num < 0)
191 {
192 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
193 }
194 }
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static unsafe IntPtr StringToHGlobalAnsi(string? s)
Definition Marshal.cs:1293

References Microsoft.Xna.Framework.Graphics.EffectParameter._handle, Microsoft.Xna.Framework.Graphics.EffectParameter._paramType, System.Runtime.InteropServices.Marshal.FreeHGlobal(), Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(), and System.value.