Exemple #1
0
        /// <summary>
        /// Checks texture-creation parameters.
        /// </summary>
        /// <param name="device">Device associated with the texture.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="mipLevelCount">Requested number of mipmap levels for the texture.</param>
        /// <param name="usage">The requested usage for the texture.</param>
        /// <param name="format">Requested format for the texture.</param>
        /// <param name="pool">Memory class where the resource will be placed.</param>
        /// <returns>
        /// A value type containing the proposed values to pass to the texture creation functions.
        /// </returns>
        /// <unmanaged>HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool)</unmanaged>
        public static TextureRequirements CheckRequirements(Device device, int width, int height, int mipLevelCount, Usage usage, Format format, Pool pool)
        {
            var result = new TextureRequirements();

            D3DX9.CheckTextureRequirements(device, ref result.Width, ref result.Height, ref result.MipLevelCount, (int)usage, ref result.Format, pool);
            return(result);
        }
Exemple #2
0
 /// <summary>
 /// Checks texture-creation parameters.
 /// </summary>
 /// <param name="device">Device associated with the texture.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="mipLevelCount">Requested number of mipmap levels for the texture.</param>
 /// <param name="usage">The requested usage for the texture.</param>
 /// <param name="format">Requested format for the texture.</param>
 /// <param name="pool">Memory class where the resource will be placed.</param>
 /// <returns>
 /// A value type containing the proposed values to pass to the texture creation functions.
 /// </returns>
 /// <unmanaged>HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool)</unmanaged>
 public static TextureRequirements CheckRequirements(Device device, int width, int height, int mipLevelCount, Usage usage, Format format, Pool pool)
 {
     var result = new TextureRequirements();
     D3DX9.CheckTextureRequirements(device, ref result.Width, ref result.Height, ref result.MipLevelCount, (int)usage, ref result.Format, pool);
     return result;
 }