nn::gd::CTR::Resource::CreateTexture2DResourceCastFrom Member Functionstatic nnResult CreateTexture2DResourceCastFrom( const Texture2DResource * initialTexture2DResource, Resource::NativeFormat format, Memory::MemoryLayout layout, Texture2DResource ** texture2DResource );
| Name | Description | |
|---|---|---|
| in | initialTexture2DResource | Specifies the original Texture2DResource to cast. |
| in | format | Specifies a new pixel format. |
| in | layout | Specifies a new memory layout. |
| out | texture2DResource | Specifies the address storing the pointer to the created resource. |
| Value | Description |
|---|---|
Result::IsSuccess |
Process was successful. |
ResultNullParameter |
NULL was specified in an argument. |
ResultInvalidTextureFormat |
The pixel format of format is invalid. The pixel size of the pixel format must be the same size as the pixel size for initialTexture2DResource. |
ResultOutOfMemory |
Memory cannot be allocated for the resource object. |
Casts an existing Texture2DResource resource to a different format.
The new Texture2DResource resource utilizes the same memory region as the original resource, but it can be defined with a different pixel format and memory layout. The pixel format of the new resource must be the same size as that of the original resource. You can use this feature to utilize Texture2DResource resources in a number of different ways. (For example, to use a resource as 2D texture in depth, shadow, and gas formats.)
CONFIDENTIAL