Nd3d11 Texture Create From File High Quality Review

if (FAILED(hr))

// Convert to 32-bit BGRA pWICFactory->CreateFormatConverter(&pConverter); pConverter->Initialize( pFrame, GUID_WICPixelFormat32bppBGRA, WICBitmapDitherTypeNone, nullptr, 0.0, WICBitmapPaletteTypeCustom ); nd3d11 texture create from file

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

hr = DirectX::CreateTexture( pDevice, scratchImage.GetImages(), scratchImage.GetImageCount(), metadata, &pTexture ); hr = DirectX::CreateTexture( pDevice

UINT width, height; pFrame->GetSize(&width, &height); UINT stride = width * 4; UINT imageSize = stride * height; BYTE* imageData = new BYTE[imageSize]; pConverter->CopyPixels(nullptr, stride, imageSize, imageData); D3D11_TEXTURE2D_DESC desc = {}; desc.Width = width; desc.Height = height; desc.MipLevels = 1; desc.ArraySize = 1; desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; desc.SampleDesc.Count = 1; desc.Usage = D3D11_USAGE_DEFAULT; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = 0; D3D11_SUBRESOURCE_DATA initData = {}; initData.pSysMem = imageData; initData.SysMemPitch = stride;

if (SUCCEEDED(hr))

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

nd3d11 texture create from file
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful. View our Privacy Policy