natiny_mesh_get_part_texture
C
NatinyTexture natiny_mesh_get_part_texture(NatinyMesh mesh, uint32_t index);
Returns the texture owned by a mesh part.
Parameters
| Name |
Type |
Description |
mesh |
NatinyMesh |
Mesh handle |
index |
uint32_t |
Zero-based part index |
Returns
| Type |
Description |
NatinyTexture |
Texture handle, or 0 when the part has no texture or the index is out of range |
Example
C
NatinyTexture texture = natiny_mesh_get_part_texture(mesh, 0);
Notes
- The texture is owned by the mesh and is destroyed together with it - do not
call
natiny_texture_destroy on it.
- An invalid mesh, out-of-range index or part without a texture returns
0.