Index

 E3d_PrintMaterial
 E3d_MaterialAppend2DTexture
 E3d_MaterialInsert2DTexture
 E3d_MaterialAdd2DTexture
 E3d_MaterialRemove2DTexture
 E3d_MaterialDefault
 E3d_MaterialAllocate
 E3d_MaterialCopyContents
 E3d_MaterialFree


E3d_PrintMaterial

Print out the attributes of a Material

Syntax
 void E3d_PrintMaterial(E3dMaterial* LMaterial)
Argument
 E3dMaterial* LMaterial      The Material to dump out
Description
Prints the attributes of the given Material to the standard output.

Return value
None.

E3d_MaterialAppend2DTexture

Append a 2DTexture to a Material

Syntax
 void E3d_MaterialAppend2DTexture(E3dMaterial* LMaterial, E3d2DTexture* L2DTexture)
Arguments
 E3dMaterial*  LMaterial      Pointer to the Material
 E3d2DTexture* L2DTexture     Pointer to the 2DTexture
Description
Appends the given 2DTexture to the given Material's dynamically allocated Textures2D array.

Return value
None.

E3d_MaterialInsert2DTexture

Append a 2DTexture to a Material

Syntax
 void E3d_MaterialInsert2DTexture(E3dMaterial* LMaterial, E3d2DTexture* L2DTexture, int LWhere)
Arguments
 E3dMaterial*  LMaterial      Pointer to the Material
 E3d2DTexture* L2DTexture     Pointer to the 2DTexture
 int           LWhere         Position in the array
Description
Inserts the given 2DTexture to the given Material's dynamically allocated Textures2D array, before the index LWhere.

Return value
None.

E3d_MaterialAdd2DTexture

Add a 2DTexture to a Material

Syntax
 E3d2DTexture* E3d_MaterialAdd2DTexture(E3dMaterial* LMaterial)
Arguments
 E3dMaterial* LMaterial      Pointer to the Materialk
Description
Creates a new 2DTexture and adds it to the given Material.

Return value
Pointer to the new 2DTexture, or NULL in case of an error

E3d_MaterialRemove2DTexture

Remove a 2DTexture from a Material

Syntax
 void E3d_MaterialRemove2DTexture(E3dMaterial* LMaterial, E3d2DTexture* L2DTexture)
Arguments
 E3dMaterial*  LMaterial      Pointer to the Material
 E3d2DTexture* L2DTexture     Pointer to the 2DTexture
Description
Removes the given 2DTexture from the given Material's dynamically allocated Textures2D array.

Return value
None.

E3d_MaterialDefault

Initialize a Material to default

Syntax
 void E3d_MaterialDefault(E3dMaterial* LMaterial, E3dShaderClass* LShaderClass)
Argument
 E3dMaterial*    LMaterial      The E3dMaterial to be initialized
Description
Prints the attributes of the given Material to the standard output.

Return value
None.

See also
E3d_MaterialAllocate, E3d_MaterialFree

E3d_MaterialAllocate

Allocate memory for a Material

Syntax
 E3dMaterial* E3d_MaterialAllocate(E3dShaderClass* LShaderClass)
Argument
 E3dShaderClass* LShaderClass       Class of shader for the new Material
Description
Allocates memory for an E3dMaterial structure and returns the pointer to the allocated memory block, or NULL in case of an error.

Return value
None.

See also
E3d_MaterialFree, E3d_MaterialDefault

E3d_MaterialCopyContents

Copy contents to a Material into another one

Syntax
 void E3d_MaterialCopyContents(E3dMaterial* LSrcMaterial, E3dMaterial* LDstMaterial)
Arguments
 E3dMaterial* LSrcMaterial   Source Material
 E3dMaterial* LDstMaterial   Destination Material
Description
Copies fields of LSrcMaterial to LDstMaterial without interfering with reference counting etc.

Return value
None.

See also
E3d_MaterialFree, E3d_MaterialDefault

E3d_MaterialFree

Free memory associated with a Material

Syntax
 void E3d_MaterialFree(E3dMaterial* LMaterial)
Argument
 E3dMaterial* LMaterial      Pointer to the Material structure to be freed
Description
This function first checks whether the reference count of the Material after decrementing is 0. If not, it means that the Material is still being referenced somewhere, so the function just exits. If the RefCnt is 0 after decrementing, the function will remove the Material from the scene, free its textures and the Material structure itself.

Return value
None.

See also
E3d_MaterialAllocate, E3d_MaterialDefault