Nd3d11 Texture Create From File Hot! -

if (SUCCEEDED(hr) && pSRV)

hr = DirectX::CreateTexture( pDevice.Get(), image.GetImages(), image.GetImageCount(), metadata, (ID3D11Resource**)pTexture.GetAddressOf() );

HRESULT hr = DirectX::LoadFromDDSFile( L"texture.dds", DirectX::DDS_FLAGS_NONE, &metadata, scratchImage ); nd3d11 texture create from file

HRESULT hr = DirectX::LoadFromWICFile( L"example.png", DirectX::WIC_FLAGS_NONE, &metadata, image );

if (FAILED(hr)) return hr;

// Create D3D11 device ComPtr<ID3D11Device> pDevice; D3D11CreateDevice( nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, &pDevice, nullptr, nullptr );

// Load texture ComPtr<ID3D11Texture2D> pTexture; DirectX::TexMetadata metadata; DirectX::ScratchImage image; HRESULT hr = DirectX::LoadFromDDSFile( L"texture.dds"

using Microsoft::WRL::ComPtr;