FPLBase
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fplbase::Material Class Reference

Collections of textures used for rendering multi-texture models. More...

#include <material.h>

Inheritance diagram for fplbase::Material:
fplbase::Asset

Detailed Description

Collections of textures used for rendering multi-texture models.

Public Member Functions

 Material ()
 Default constructor for Material.
 
void Set (Renderer &renderer)
 Set the renderer for this Material. More...
 
std::vector< Texture * > & textures ()
 Get all Textures from this Material. More...
 
const std::vector< Texture * > & textures () const
 Get all Textures from this Material. More...
 
int blend_mode () const
 Get the blend mode for this Material. More...
 
void set_blend_mode (BlendMode blend_mode)
 Set the blend mode. More...
 
void DeleteTextures ()
 Delete all Textures in this Material.
 
- Public Member Functions inherited from fplbase::Asset
void IncreaseRefCount ()
 indicate there is an additional owner of this asset. By default, when you call any of the UnLoad*() functions in the AssetManager, that will directly delete the asset since they all start out with a single reference count. Call this function to indicate multiple owners will call Unload*() independently, and only have the asset deleted by the last one.
 

Static Public Member Functions

static MaterialLoadFromMaterialDef (const char *filename, const TextureLoaderFn &tlf)
 Load a .fplmat file, and all the textures referenced from it. Used by the more convenient AssetManager interface, but can be used without it.
 

Member Function Documentation

int fplbase::Material::blend_mode ( ) const
inline

Get the blend mode for this Material.

Returns
Returns an int corresponding the the BlendMode enum for this Material.
void fplbase::Material::Set ( Renderer renderer)

Set the renderer for this Material.

Parameters
[in]rendererThe renderer to set for this Material.
void fplbase::Material::set_blend_mode ( BlendMode  blend_mode)
inline

Set the blend mode.

Parameters
[in]blend_modeA BlendMode enum corresponding to the blend mode to set for this texture.
Warning
Asserts if an invalid enum value for blend_mode is passed in.
std::vector<Texture *>& fplbase::Material::textures ( )
inline

Get all Textures from this Material.

Returns
Returns a std::vector<Texture *> reference to get all the Textures from this Material.
const std::vector<Texture *>& fplbase::Material::textures ( ) const
inline

Get all Textures from this Material.

Returns
Returns a const std::vector<Texture *> reference to get all the Textures from this Material.

The documentation for this class was generated from the following file: