19 #define DEFAULT_MATERIAL_NAME "default"
22 #define DEFAULT_UI_MATERIAL_NAME "default_ui"
25 #define DEFAULT_TERRAIN_MATERIAL_NAME "default_terrain"
This file contains global type definitions which are used throughout the entire engine and applicatio...
#define KAPI
Import/export qualifier.
Definition: defines.h:177
unsigned int u32
Unsigned 32-bit integer.
Definition: defines.h:25
_Bool b8
8-bit boolean type
Definition: defines.h:58
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
KAPI material * material_system_acquire_terrain_material(const char *material_name, u32 material_count, const char **material_names, b8 auto_release)
Attempts to acquire a terrain material with the given name. If it has not yet been loaded,...
KAPI b8 material_system_apply_global(u32 shader_id, const struct frame_data *p_frame_data, const mat4 *projection, const mat4 *view, const vec4 *ambient_colour, const vec3 *view_position, u32 render_mode)
Applies global-level data for the material shader id.
KAPI void material_system_release(const char *name)
Releases a material with the given name. Ignores non-existant materials. Decreases the reference coun...
KAPI void material_system_dump(void)
Dumps all of the registered materials and their reference counts/handles.
KAPI b8 material_system_apply_local(material *m, const mat4 *model)
Applies local-level material data (typically just model matrix).
KAPI b8 material_system_apply_instance(material *m, struct frame_data *p_frame_data, b8 needs_update)
Applies instance-level material data for the given material.
KAPI material * material_system_acquire_from_config(material_config *config)
Attempts to acquire a material from the given configuration. If it has not yet been loaded,...
KAPI material * material_system_get_default(void)
Gets a pointer to the default material. Does not reference count.
struct material_system_config material_system_config
The configuration for the material system.
KAPI material * material_system_get_default_terrain(void)
Gets a pointer to the default terrain material. Does not reference count.
KAPI material * material_system_acquire(const char *name)
Attempts to acquire a material with the given name. If it has not yet been loaded,...
void material_system_shutdown(void *state)
Shuts down the material system.
KAPI material * material_system_get_default_ui(void)
Gets a pointer to the default UI material. Does not reference count.
b8 material_system_initialize(u64 *memory_requirement, void *state, void *config)
Initializes the material system. Should be called twice; once to get the memory requirement (passing ...
This file contains the types for common resources the engine uses.
Engine-level current frame-specific data.
Definition: frame_data.h:16
Definition: resource_types.h:528
The configuration for the material system.
Definition: material_system.h:28
u32 max_material_count
The maximum number of loaded materials.
Definition: material_system.h:30
A material, which represents various properties of a surface in the world such as texture,...
Definition: resource_types.h:569
a 4x4 matrix, typically used to represent object transformations.
Definition: math_types.h:147
A 3-element vector.
Definition: math_types.h:49
A 4-element vector.
Definition: math_types.h:89