nn::gd::CTR::Resource::CreateTexture2DResource Member Functionstatic nnResult CreateTexture2DResource( const Texture2DResourceDescription * description, const void * initialData, gdBool autoGenerateMipMapsFromData, Texture2DResource ** texture2DResource );
| Name | Description | |
|---|---|---|
| in | description | Specifies the descriptor for creating a 2D texture resource. |
| in | initialData | Specifies the initialization data for the texture resource. Specify NULL if there is no initialization data. If there is mipmap data, all of the levels need to be specified, so set autoGenerateMipMapsFromData to GD_FALSE. If you are using automatically created mipmaps, specify only the top level of mipmap data. The initialization data must be created in LAYOUT_BLOCK_8 mode. (Helper::ConvertTextureResourceToNativeFormat orHelper::ConvertCompressedTextureResourceToNativeFormat) |
| in | autoGenerateMipMapsFromData | Specify to enable/disable automatic creation of mipmaps. |
| out | texture2DResource | Specifies the address storing the created 2D texture resource. |
| Value | Description |
|---|---|
ResultSuccess |
Process was successful. |
| ResultNullParameter | NULL was specified for description or texture2DResource. |
| ResultInvalidTextureResolution | O was specified for either m_Width or m_Height of Texture2DResourceDescription. The result is also returned if the layout is LAYOUT_BLOCK_32 and the size in not correctly aligned. Also, this result is returned if a mipmap cannot be created for the given size of m_Width or m_Height for Texture2DResourceDescription. The specified size must be a power of 2. |
| ResultInvalidTextureMipLevelIndex | The mipmap level index is invalid. |
| ResultInvalidMemoryLayout | Memory layout is not correct. This result is also returned if initialization data has been specified but the memory layout is not Memory::LAYOUT_BLOCK_8. |
| ResultInvalidMemoryLocation | The memory type is not valid. |
| ResultInvalidTextureFormat | Invalid pixel format. This result is also returned if the initialization data is in ETC format and mipmaps cannot be automatically created. |
| ResultOutOfMemory | Cannot obtain memory for the resource |
| ResultOutOfMemoryExt | Cannot obtain memory for the data. |
Creates a 2D texture resource.
Texture2DResourceDescription
Helper::ConvertTextureResourceToNativeFormat
Helper::ConvertCompressedTextureResourceToNativeFormat
CONFIDENTIAL