natiny_texture_create
C
NatinyTexture natiny_texture_create(NatinyResource resource);
Creates a texture from an image resource.
Parameters
| Name |
Type |
Description |
resource |
NatinyResource |
Resource handle containing encoded image data |
Returns
| Type |
Description |
NatinyTexture |
Texture handle, or 0 on failure |
Example
C
NatinyTexture texture = natiny_texture_create(image_resource);
Notes
- Supports JPEG, PNG, TGA, BMP, PSD composite images, GIF, Radiance HDR, PIC
and binary PNM. For GIF images, only the first frame is loaded.
- An invalid resource or image decoding failure returns
0.
- Image data is copied, so the resource can be destroyed after this call.
- A complete mip chain is generated. Select its filtering with
natiny_material_set_texture.