/// <summary> /// Loads a texture from an image file. /// </summary> /// <param name = "device">The device used to load the texture.</param> /// <param name = "fileName">Path to the file on disk.</param> /// <param name = "loadInfo">Specifies information used to load the texture.</param> /// <returns>The loaded texture object.</returns> public static T FromFile <T>(Device device, string fileName, ImageLoadInformation loadInfo) where T : Resource { IntPtr temp; Result resultOut; D3DX10.CreateTextureFromFile(device, fileName, loadInfo, IntPtr.Zero, out temp, out resultOut); // TODO test resultOut? return(FromPointer <T>(temp)); }
/// <summary> /// Loads a texture from an image file. /// </summary> /// <param name = "device">The device used to load the texture.</param> /// <param name = "fileName">Path to the file on disk.</param> /// <returns>The loaded texture object.</returns> public static T FromFile <T>(Device device, string fileName) where T : Resource { IntPtr temp; Result resultOut; D3DX10.CreateTextureFromFile(device, fileName, null, IntPtr.Zero, out temp, out resultOut); // TODO Test resultOut return(FromPointer <T>(temp)); }
/// <summary> /// Loads a texture from an image file. /// </summary> /// <param name = "device">The device used to load the texture.</param> /// <param name = "fileName">Path to the file on disk.</param> /// <param name = "loadInfo">Specifies information used to load the texture.</param> /// <returns>The loaded texture object.</returns> public static T FromFile <T>(Device device, string fileName, ImageLoadInformation loadInfo) where T : Resource { System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) || typeof(T) == typeof(Texture3D)); IntPtr temp; Result resultOut; D3DX10.CreateTextureFromFile(device, fileName, loadInfo, IntPtr.Zero, out temp, out resultOut); // TODO test resultOut? return(FromPointer <T>(temp)); }