Ejemplo n.º 1
0
        /// <summary>
        /// Create a shader-resource view from a file.
        /// </summary>
        /// <param name="device">A reference to the device (see <see cref="SharpDX.Direct3D10.Device"/>) that will use the resource. </param>
        /// <param name="fileName">Name of the file that contains the shader-resource view.</param>
        /// <param name="loadInformation">Identifies the characteristics of a texture (see <see cref="SharpDX.Direct3D10.ImageLoadInformation"/>) when the data processor is created. </param>
        /// <returns>Returns a reference to the shader-resource view (see <see cref="SharpDX.Direct3D10.ShaderResourceView"/>). </returns>
        /// <unmanaged>HRESULT D3DX10CreateShaderResourceViewFromFileW([None] ID3D10Device* pDevice,[None] const wchar_t* pSrcFile,[In, Optional] D3DX10_IMAGE_LOAD_INFO* pLoadInfo,[None] ID3DX10ThreadPump* pPump,[None] ID3D10ShaderResourceView** ppShaderResourceView,[None] HRESULT* pHResult)</unmanaged>
        public static ShaderResourceView FromFile(Device device, string fileName, ImageLoadInformation loadInformation)
        {
            ShaderResourceView temp;
            Result             hResult;

            D3DX10.CreateShaderResourceViewFromFile(device, fileName, loadInformation, IntPtr.Zero, out temp, out hResult);
            return(temp);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a shader-resource view from a file. Read the characteristics of a texture when the texture is loaded.
        /// </summary>
        /// <param name="device">A reference to the device (see <see cref="SharpDX.Direct3D10.Device"/>) that will use the resource. </param>
        /// <param name="fileName">Name of the file that contains the shader-resource view.</param>
        /// <returns>Returns a reference to the shader-resource view (see <see cref="SharpDX.Direct3D10.ShaderResourceView"/>). </returns>
        /// <unmanaged>HRESULT D3DX10CreateShaderResourceViewFromFileW([None] ID3D10Device* pDevice,[None] const wchar_t* pSrcFile,[In, Optional] D3DX10_IMAGE_LOAD_INFO* pLoadInfo,[None] ID3DX10ThreadPump* pPump,[None] ID3D10ShaderResourceView** ppShaderResourceView,[None] HRESULT* pHResult)</unmanaged>
        public static ShaderResourceView FromFile(Device device, string fileName)
        {
            ShaderResourceView temp;
            Result             hResult;

            D3DX10.CreateShaderResourceViewFromFile(device, fileName, null, IntPtr.Zero, out temp, out hResult);
            return(temp);
        }