Material

Types

struct Material A 32 bit handle.

Creation & Destruction

Material_Create( Shader shader) : Material
Creates a new material using the provided shader.

Material_Clone( Material material ) : Material
Creates a copy of the material.

Material_Destroy( Material material ) : Material
Destroys the material.

Functions

Material_Exists( Material material ) : bool
Returns true if the material exists.

Material_Color( Material material, uint32_t index ) : Float4
Returns the color at index, or NaN if the material is null or the index is out of range.

Material_Texture( Material material, uint32_t index ) : Texture
Returns the texture at index, or null if the material is null or the index is out of range.

Material_UVScaleOffset( Material material, uint32_t index ) : Float4
Returns the scale in xy and offset in zw at index, or NaN if the material is null or the index is out of range.

Material_Shader( Material material ) : Shader
Returns the shader, or null if the material is null.

Material_RenderQueue( Material material ) : uint16_t
Returns the render queue, or 65535 if the material is null.

Material_LastModifiedFrame( Material material ) : uint64_t
Returns the last frame this object was modified, or 0 if the material is null.

Methods

Material_SetColor( Material material, uint32_t index, Float4 color ) : void
Set the color at index. This marks the object as modified.

Material_SetTexture( Material material, uint32_t index, Texture texture ) : void
Set the texture at index. This marks the object as modified. NOTE - texture pointer, size, and sampler states are cached on assignment. Modification of texture settings at runtime is not well supported.

Material_SetUVScaleOffset( Material material, uint32_t index, Float4 uv_scale_offset ) : void
Set the uv scale in xy, and offset in zw at index. This marks the object as modified.

Material_SetShader( Material material, Shader shader ) : void
Set the shader. This does not mark the object as modified.

Material_SetRenderQueue( Material material, uint16_t render_queue ) : void
Set the render queue for ordering. This does not mark the object as modified.