Declares things related to loading and managing models.
More...
Go to the source code of this file.
|
VK2DModel | vk2dModelCreate (const VK2DVertex3D *vertices, uint32_t vertexCount, const uint16_t *indices, uint32_t indexCount, VK2DTexture tex) |
| Creates a model from a set of vertices. More...
|
|
VK2DModel | vk2dModelFrom (const void *objFile, uint32_t objFileSize, VK2DTexture texture) |
| Loads a .obj model from a binary buffer. More...
|
|
VK2DModel | vk2dModelLoad (const char *objFile, VK2DTexture texture) |
| Loads a model from a .obj file. More...
|
|
void | vk2dModelFree (VK2DModel model) |
| The texture stored in the model is not destroyed. More...
|
|
Declares things related to loading and managing models.
- Author
- Paolo Mazzon
◆ vk2dModelCreate()
VK2DModel vk2dModelCreate |
( |
const VK2DVertex3D * |
vertices, |
|
|
uint32_t |
vertexCount, |
|
|
const uint16_t * |
indices, |
|
|
uint32_t |
indexCount, |
|
|
VK2DTexture |
tex |
|
) |
| |
Creates a model from a set of vertices.
- Parameters
-
vertices | List of VK2DVertex3D vertices the model will use |
vertexCount | Number of vertices in the list |
indices | List of uint16_t indices for the vertex list |
indexCount | Number of indices in the list |
tex | Texture bound to the texture |
- Returns
- Returns a new VK2DModel or NULL if it fails
- Warning
- The input must be triangulated.
◆ vk2dModelFree()
void vk2dModelFree |
( |
VK2DModel |
model | ) |
|
The texture stored in the model is not destroyed.
- Parameters
-
model | Model to free from memory |
◆ vk2dModelFrom()
VK2DModel vk2dModelFrom |
( |
const void * |
objFile, |
|
|
uint32_t |
objFileSize, |
|
|
VK2DTexture |
texture |
|
) |
| |
Loads a .obj model from a binary buffer.
- Parameters
-
objFile | .obj file binary buffer |
objFileSize | Size of the buffer in bytes |
texture | Texture the .obj file expects |
- Returns
- Returns a new model or NULL if it fails
- Warning
- This function is very taxing as it builds a proper index list from the loaded model to save video memory
◆ vk2dModelLoad()
VK2DModel vk2dModelLoad |
( |
const char * |
objFile, |
|
|
VK2DTexture |
texture |
|
) |
| |
Loads a model from a .obj file.
- Parameters
-
objFile | Path to the .obj file |
texture | Texture the .obj file expects |
- Returns
- Returns a new model or NULL if it fails
- Warning
- This function is very taxing as it builds a proper index list from the loaded model to save video memory