Пример #1
0
        // Method to marshal from native to managed struct
        internal unsafe void __MarshalFrom(ref __Native @ref)
        {
            this.Size = @ref.Size;
            this.Guid = @ref.Guid;
            this.EffectParametersPointer = @ref.EffectParametersPointer;

            fixed(void *__ptr = & @ref.Name) this.Name = Utilities.PtrToStringAnsi((IntPtr)__ptr, 260);

            if (this.EffectParametersPointer != IntPtr.Zero)
            {
                Parameters = new EffectParameters();
                Parameters.__MarshalFrom(ref *(EffectParameters.__Native *)EffectParametersPointer);
                EffectParametersPointer = IntPtr.Zero;
            }
        }
Пример #2
0
 /// <summary>
 /// Sets the characteristics of an effect.
 /// </summary>
 /// <param name="parameters">The parameters of this effect.</param>
 /// <returns>A <see cref = "T:SharpDX.Result" /> object describing the result of the operation.</returns>
 public void SetParameters(EffectParameters parameters)
 {
     SetParameters(parameters, EffectParameterFlags.All);
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Effect"/> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="guid">The GUID.</param>
 /// <param name="parameters">The parameters.</param>
 public Effect(Device device, Guid guid, EffectParameters parameters)
 {
     device.CreateEffect(guid, parameters, this, null);
 }
Пример #4
0
 /// <summary>
 /// Sets the characteristics of an effect.
 /// </summary>
 /// <param name="parameters">The parameters of this effect.</param>
 /// <returns>A <see cref = "T:SharpDX.Result" /> object describing the result of the operation.</returns>
 public void SetParameters(EffectParameters parameters)
 {
     SetParameters(parameters, EffectParameterFlags.All);
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Effect"/> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="guid">The GUID.</param>
 /// <param name="parameters">The parameters.</param>
 public Effect(Device device, Guid guid, EffectParameters parameters)
 {
     device.CreateEffect(guid, parameters, this, null);
 }
Пример #6
0
        // Method to marshal from native to managed struct
        internal unsafe void __MarshalFrom(ref __Native @ref)
        {
            this.Size = @ref.Size;
            this.Guid = @ref.Guid;
            this.EffectParametersPointer = @ref.EffectParametersPointer;
            fixed (void* __ptr = &@ref.Name) this.Name = Utilities.PtrToStringAnsi((IntPtr)__ptr, 260);

            if (this.EffectParametersPointer != IntPtr.Zero)
            {
                Parameters = new EffectParameters();
                Parameters.__MarshalFrom(ref *(EffectParameters.__Native*)EffectParametersPointer);
                EffectParametersPointer = IntPtr.Zero;
            }
        }