Exemplo n.º 1
0
        /// <summary>
        /// Get an array of four-component vectors that contain floating-point data.
        /// </summary>
        /// <param name="count">The number of array elements to set. </param>
        /// <returns>Returns an array of four-component vectors that contain floating-point data. </returns>
        /// <unmanaged>HRESULT ID3D10EffectVectorVariable::GetFloatVectorArray([None] float* pData,[None] int Offset,[None] int Count)</unmanaged>
        public RawVector4[] GetFloatVectorArray(int count)
        {
            var temp = new RawVector4[count];

            GetFloatVectorArray(temp, 0, count);
            return(temp);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Sets a 4D vector.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="effectHandle">The effect handle.</param>
 /// <param name="value">The value.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT ID3DXConstantTable::SetVector([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector)</unmanaged>
 public void SetValue(Device device, EffectHandle effectHandle, RawVector4 value)
 {
     SetVector(device, effectHandle, value);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the named property to the given value.
 /// </summary>
 /// <param name="index">Index of the property</param>
 /// <param name="value">Value of the property</param>
 /// <unmanaged>HRESULT ID2D1Properties::SetValue([In] const wchar_t* name,[In] D2D1_PROPERTY_TYPE type,[In, Buffer] const void* data,[In] unsigned int dataSize)</unmanaged>
 public unsafe void SetValue(int index, RawVector4 value)
 {
     SetValue(index, PropertyType.Vector4, new IntPtr(&value), sizeof(RawVector4));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Sets the named property to the given value.
 /// </summary>
 /// <param name="name">Name of the property</param>
 /// <param name="value">Value of the property</param>
 /// <unmanaged>HRESULT ID2D1Properties::SetValueByName([In] const wchar_t* name,[In] D2D1_PROPERTY_TYPE type,[In, Buffer] const void* data,[In] unsigned int dataSize)</unmanaged>
 public unsafe void SetValueByName(string name, RawVector4 value)
 {
     SetValueByName(name, PropertyType.Vector4, new IntPtr(&value), sizeof(RawVector4));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets a 4D vector.
 /// </summary>
 /// <param name="effectHandle">The effect handle.</param>
 /// <param name="value">The value.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT ID3DXBaseEffect::SetVector([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector)</unmanaged>
 public void SetValue(EffectHandle effectHandle, RawVector4 value)
 {
     SetVector(effectHandle, value);
 }
Exemplo n.º 6
0
        internal static RawColor4 ToColor4(System.Drawing.Color color)
        {
            RawVector4 vec = new RawVector4(color.R > 0 ? (Single)(color.R / 255.0f) : 0.0f, color.G > 0 ? (Single)(color.G / 255.0f) : 0.0f, color.B > 0 ? (Single)(color.B / 255.0f) : 0.0f, color.A > 0 ? (Single)(color.A / 255.0f) : 0.0f);

            return(new RawColor4(vec.W, vec.X, vec.Y, vec.Z));
        }