tex3ds support
More...
#include <citro3d.h>
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
|
Tex3DS_Texture | Tex3DS_TextureImport (const void *input, size_t insize, C3D_Tex *tex, C3D_TexCube *texcube, bool vram) |
| Import Tex3DS texture. More...
|
|
Tex3DS_Texture | Tex3DS_TextureImportCallback (C3D_Tex *tex, C3D_TexCube *texcube, bool vram, decompressCallback callback, void *userdata) |
| Import Tex3DS texture. More...
|
|
Tex3DS_Texture | Tex3DS_TextureImportFD (int fd, C3D_Tex *tex, C3D_TexCube *texcube, bool vram) |
| Import Tex3DS texture. More...
|
|
Tex3DS_Texture | Tex3DS_TextureImportStdio (FILE *fp, C3D_Tex *tex, C3D_TexCube *texcube, bool vram) |
| Import Tex3DS texture. More...
|
|
size_t | Tex3DS_GetNumSubTextures (const Tex3DS_Texture texture) |
| Get number of subtextures. More...
|
|
const Tex3DS_SubTexture * | Tex3DS_GetSubTexture (const Tex3DS_Texture texture, size_t index) |
| Get subtexture. More...
|
|
static bool | Tex3DS_SubTextureRotated (const Tex3DS_SubTexture *subtex) |
| Check if subtexture is rotated. More...
|
|
static void | Tex3DS_SubTextureBottomLeft (const Tex3DS_SubTexture *subtex, float *u, float *v) |
| Get bottom-left texcoords. More...
|
|
static void | Tex3DS_SubTextureBottomRight (const Tex3DS_SubTexture *subtex, float *u, float *v) |
| Get bottom-right texcoords. More...
|
|
static void | Tex3DS_SubTextureTopLeft (const Tex3DS_SubTexture *subtex, float *u, float *v) |
| Get top-left texcoords. More...
|
|
static void | Tex3DS_SubTextureTopRight (const Tex3DS_SubTexture *subtex, float *u, float *v) |
| Get top-right texcoords. More...
|
|
void | Tex3DS_TextureFree (Tex3DS_Texture texture) |
| Free Tex3DS texture. More...
|
|
◆ Tex3DS_SubTexture
Subtexture.
- Note
- If top < bottom, the subtexture is rotated 1/4 revolution counter-clockwise
◆ Tex3DS_GetNumSubTextures()
Get number of subtextures.
- Parameters
-
[in] | texture | Tex3DS texture |
- Returns
- Number of subtextures
◆ Tex3DS_GetSubTexture()
Get subtexture.
- Parameters
-
[in] | texture | Tex3DS texture |
[in] | index | Subtexture index |
- Returns
- Subtexture info
◆ Tex3DS_SubTextureBottomLeft()
static void Tex3DS_SubTextureBottomLeft |
( |
const Tex3DS_SubTexture * |
subtex, |
|
|
float * |
u, |
|
|
float * |
v |
|
) |
| |
|
inlinestatic |
Get bottom-left texcoords.
- Parameters
-
[in] | subtex | Subtexture |
[out] | u | u-coordinate |
[out] | v | v-coordinate |
◆ Tex3DS_SubTextureBottomRight()
static void Tex3DS_SubTextureBottomRight |
( |
const Tex3DS_SubTexture * |
subtex, |
|
|
float * |
u, |
|
|
float * |
v |
|
) |
| |
|
inlinestatic |
Get bottom-right texcoords.
- Parameters
-
[in] | subtex | Subtexture |
[out] | u | u-coordinate |
[out] | v | v-coordinate |
◆ Tex3DS_SubTextureRotated()
Check if subtexture is rotated.
- Parameters
-
[in] | subtex | Subtexture to check |
- Returns
- whether subtexture is rotated
◆ Tex3DS_SubTextureTopLeft()
static void Tex3DS_SubTextureTopLeft |
( |
const Tex3DS_SubTexture * |
subtex, |
|
|
float * |
u, |
|
|
float * |
v |
|
) |
| |
|
inlinestatic |
Get top-left texcoords.
- Parameters
-
[in] | subtex | Subtexture |
[out] | u | u-coordinate |
[out] | v | v-coordinate |
◆ Tex3DS_SubTextureTopRight()
static void Tex3DS_SubTextureTopRight |
( |
const Tex3DS_SubTexture * |
subtex, |
|
|
float * |
u, |
|
|
float * |
v |
|
) |
| |
|
inlinestatic |
Get top-right texcoords.
- Parameters
-
[in] | subtex | Subtexture |
[out] | u | u-coordinate |
[out] | v | v-coordinate |
◆ Tex3DS_TextureFree()
Free Tex3DS texture.
- Parameters
-
[in] | texture | Tex3DS texture to free |
◆ Tex3DS_TextureImport()
Import Tex3DS texture.
- Parameters
-
[in] | input | Input data |
[in] | insize | Size of the input data |
[out] | tex | citro3d texture |
[out] | texcube | citro3d texcube |
[in] | vram | Whether to store textures in VRAM |
- Returns
- Tex3DS texture
◆ Tex3DS_TextureImportCallback()
Import Tex3DS texture.
@description For example, use this if you want to import from a large file without pulling the entire file into memory.
- Parameters
-
[out] | tex | citro3d texture |
[out] | texcube | citro3d texcube |
[in] | vram | Whether to store textures in VRAM |
[in] | callback | Data callback |
[in] | userdata | User data passed to callback |
- Returns
- Tex3DS texture
◆ Tex3DS_TextureImportFD()
Import Tex3DS texture.
Starts reading at the current file descriptor's offset. The file descriptor's position is left at the end of the decoded data. On error, the file descriptor's position is indeterminate.
- Parameters
-
[in] | fd | Open file descriptor |
[out] | tex | citro3d texture |
[out] | texcube | citro3d texcube |
[in] | vram | Whether to store textures in VRAM |
- Returns
- Tex3DS texture
◆ Tex3DS_TextureImportStdio()
Import Tex3DS texture.
Starts reading at the current file stream's offset. The file stream's position is left at the end of the decoded data. On error, the file stream's position is indeterminate.
- Parameters
-
[in] | fp | Open file stream |
[out] | tex | citro3d texture |
[out] | texcube | citro3d texcube |
[in] | vram | Whether to store textures in VRAM |
- Returns
- Tex3DS texture