libsf3
|
#include "sf3_core.h"
Go to the source code of this file.
Data Structures | |
struct | sf3_faces |
An array of faces. More... | |
struct | sf3_vertices |
An array of vertex data. More... | |
struct | sf3_model |
Macros | |
#define | SF3_FORMAT_ID_MODEL 0x05 |
The format_id for a model file. | |
Enumerations | |
enum | sf3_material_type { SF3_MATERIAL_ALBEDO = 0x01 , SF3_MATERIAL_NORMAL = 0x02 , SF3_MATERIAL_METALLIC = 0x04 , SF3_MATERIAL_METALNESS = 0x08 , SF3_MATERIAL_ROUGHNESS = 0x10 , SF3_MATERIAL_OCCLUSION = 0x20 , SF3_MATERIAL_SPECULAR = 0x40 , SF3_MATERIAL_EMISSION = 0x80 } |
The material types that can be stored, as bit-field flags. More... | |
enum | sf3_vertex_format { SF3_VERTEX_POSITION = 0x01 , SF3_VERTEX_UV = 0x02 , SF3_VERTEX_COLOR = 0x04 , SF3_VERTEX_NORMAL = 0x08 , SF3_VERTEX_TANGENT = 0x10 } |
The vertex attributes that can be stored, as bit-field flags. More... | |
Functions | |
SF3_INLINE const sf3_str16 * | sf3_model_next_texture (const struct sf3_str16 *texture) |
SF3_INLINE const struct sf3_faces * | sf3_model_faces (const struct sf3_model *model) |
Returns the faces array of the model. | |
SF3_INLINE const struct sf3_vertices * | sf3_model_vertices (const struct sf3_model *model) |
Returns the vertices array of the model. | |
SF3_INLINE uint8_t | sf3_model_texture_count (const struct sf3_model *model) |
Returns the number of textures stored in the model. | |
SF3_INLINE uint8_t | sf3_model_vertex_stride (const struct sf3_model *model) |
Returns the number of floats per vertex. | |
SF3_INLINE uint8_t | sf3_model_vertex_attribute_count (enum sf3_vertex_format format) |
SF3_INLINE uint32_t | sf3_model_vertex_count (const struct sf3_model *model) |
Returns the number of vertices stored in the model. | |
SF3_EXPORT enum sf3_material_type | sf3_model_texture_material (const struct sf3_model *model, uint8_t index) |
Returns the material usage type for the given texture index in the model. | |
SF3_EXPORT const char * | sf3_model_material_type (enum sf3_material_type type) |
SF3_EXPORT size_t | sf3_model_size (const struct sf3_model *model) |
Computes the size of the model file in bytes. | |
#define SF3_FORMAT_ID_MODEL 0x05 |
The format_id for a model file.
Definition at line 6 of file sf3_model.h.
enum sf3_material_type |
The material types that can be stored, as bit-field flags.
Definition at line 9 of file sf3_model.h.
enum sf3_vertex_format |
The vertex attributes that can be stored, as bit-field flags.
Definition at line 30 of file sf3_model.h.
SF3_INLINE const struct sf3_faces * sf3_model_faces | ( | const struct sf3_model * | model | ) |
Returns the faces array of the model.
Definition at line 82 of file sf3_model.h.
SF3_EXPORT const char * sf3_model_material_type | ( | enum sf3_material_type | type | ) |
Returns a human-readable string describing the material type. Note that you cannot call this with a combination of material types flags, only with a singular type as outlined in the sf3_material_type
enumeration.
Definition at line 155 of file sf3_model.h.
SF3_INLINE const sf3_str16 * sf3_model_next_texture | ( | const struct sf3_str16 * | texture | ) |
Returns the next texture after this one. Note that this function does not perform any bounds checking whatsoever. It is up to you to ensure you do not call this with the last texture.
Definition at line 77 of file sf3_model.h.
SF3_EXPORT size_t sf3_model_size | ( | const struct sf3_model * | model | ) |
Computes the size of the model file in bytes.
Definition at line 170 of file sf3_model.h.
SF3_INLINE uint8_t sf3_model_texture_count | ( | const struct sf3_model * | model | ) |
Returns the number of textures stored in the model.
Definition at line 93 of file sf3_model.h.
SF3_EXPORT enum sf3_material_type sf3_model_texture_material | ( | const struct sf3_model * | model, |
uint8_t | index | ||
) |
Returns the material usage type for the given texture index in the model.
Definition at line 138 of file sf3_model.h.
SF3_INLINE uint8_t sf3_model_vertex_attribute_count | ( | enum sf3_vertex_format | format | ) |
Returns the number of floats per the specified attribute. Note that you cannot call this with a combination of vertex format type flags, only with a singular format type as outlined in the sf3_vertex_format
enumeration. If the attribute is unknown, 0 is returned.
Definition at line 121 of file sf3_model.h.
SF3_INLINE uint32_t sf3_model_vertex_count | ( | const struct sf3_model * | model | ) |
Returns the number of vertices stored in the model.
Definition at line 133 of file sf3_model.h.
SF3_INLINE uint8_t sf3_model_vertex_stride | ( | const struct sf3_model * | model | ) |
Returns the number of floats per vertex.
Definition at line 106 of file sf3_model.h.
SF3_INLINE const struct sf3_vertices * sf3_model_vertices | ( | const struct sf3_model * | model | ) |
Returns the vertices array of the model.
Definition at line 87 of file sf3_model.h.