CreateTextureEx

Creates a Direct3D 11 texture resource from a set of images, specifying extended parameters to control the created resource’s usage, binding flags, CPU access flags, and miscellaneous flags.

Syntax

HRESULT CreateTextureEx(
         ID3D11Device *pDevice,
         const Image *srcImages,
         size_t nimages,
         const TexMetadata &metadata,
         D3D11_USAGE usage,
         unsigned int bindFlags,
         unsigned int cpuAccessFlags,
         unsigned int miscFlags,
         bool forceSRGB,
         ID3D11Resource **ppResource
)  

Parameters

pDevice
Type: ID3D11Device *

[in] A DirectX 11 device, as a pointer to an ID3D11Device.

srcImages
Type: Image *

[in] Pointer to one or more Image structures in a memory buffer.

nimages
Type: size_t 

[in] The number of images.

metadata
Type: TexMetadata 

[in] The address of a TexMetadata structure.

usage
Type: D3D11_USAGE 

[in] Usage, as a D3D11_USAGE enumeration constant.

bindFlags
Type: unsigned int 

[in] A combination of D3D11_BIND_FLAG values that are combined by using a bitwise OR operation. The resulting value identifies how the resource will be bound to the pipeline.

cpuAccessFlags
Type: unsigned int 

[in] A combination of D3D11_CPU_ACCESS_FLAG values that are combined by using a bitwise OR operation, or 0 if no CPU access is necessary.

miscFlags
Type: unsigned int 

[in] A combination of D3D11_RESOURCE_MISC_FLAG values that are combined by using a bitwise OR operation, or 0 if unused.

forceSRGB
Type: bool 

[in] Whether to force the resource to use standard RGB.

ppResource
Type: ID3D11Resource **

[out] A resource, as a pointer to an ID3D11Resource.

Return value

Type: HRESULT 

Success or error code.

Requirements

Header: Declared in directxtex.h.