This is a version of DDSTextureLoader for use by Xbox One XDK developers. This loads pre-tiled texture resources for use with the CreatePlacement APIs available to Xbox One exclusive app developers.
These pre-tiled resources are stored in a variant of the .DDS file format marked with the "XBOX" FourCC pixel format. To generate these .DDS files, see the xtexconv sample on the Microsoft Game Developer Network site https://developer.xboxlive.com/en-us/platform/development/education/Pages/Samples.aspx.
CreateDDSTextureFromMemory
CreateDDSTextureFromFile
These are equivalent to the same functions in DDSTextureLoader, but also require a ID3DXboxPerformanceDevice interface and return a pointer to the video memory via grfxMemory which the caller is responsible for releasing with D3DFreeGraphicsMemory
These pre-tiled resources are stored in a variant of the .DDS file format marked with the "XBOX" FourCC pixel format. To generate these .DDS files, see the xtexconv sample on the Microsoft Game Developer Network site https://developer.xboxlive.com/en-us/platform/development/education/Pages/Samples.aspx.
Functions
These are in the 'Xbox' namespace rather than 'DirectX'CreateDDSTextureFromMemory
CreateDDSTextureFromFile
These are equivalent to the same functions in DDSTextureLoader, but also require a ID3DXboxPerformanceDevice interface and return a pointer to the video memory via grfxMemory which the caller is responsible for releasing with D3DFreeGraphicsMemory
HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device1* d3dDevice, _In_ ID3DXboxPerformanceDevice* perfDevice, _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, _In_ size_t ddsDataSize, _Outptr_opt_ ID3D11Resource** texture, _Outptr_opt_ ID3D11ShaderResourceView** textureView, _Outptr_ void** grfxMemory, _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr, _In_ bool forceSRGB = false );
HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device1* d3dDevice, _In_ ID3DXboxPerformanceDevice* perfDevice, _In_z_ constwchar_t* szFileName, _Outptr_opt_ ID3D11Resource** texture, _Outptr_opt_ ID3D11ShaderResourceView** textureView, _Outptr_ void** grfxMemory, _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr, _In_ bool forceSRGB = false );
Example
usingnamespace Microsoft::WRL; ComPtr<ID3D11ShaderResourceView> srv; void *grfxMemory = nullptr; DX::ThrowIfFailed( Xbox::CreateDDSTextureFromFile( m_device.Get(), m_xboxDevice.Get(), L"XboxTiledTexturedds", nullptr, srv.GetAddressOf(), &grfxMemory ) );