Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
Material Class Reference

Material. More...

#include <Material.h>

Inherits Object.

Inherited by MeshMaterial.

Public Member Functions

std::string getName () const
 returns the material name
 
void setName (std::string_view name)
 sets the material name
 
TechniquegetTechniqueByName (std::string_view name)
 Returns a Technique by its name.
 
TechniquegetTechniqueByIndex (ssize_t index)
 Returns a Technique by index.
 
TechniquegetTechnique () const
 Returns the Technique used by the Material.
 
const Vector< Technique * > & getTechniques () const
 Returns the list of Techniques.
 
ssize_t getTechniqueCount () const
 Returns the number of Techniques in the Material.
 
void addTechnique (Technique *technique)
 Adds a Technique into the Material.
 
void setTechnique (std::string_view techniqueName)
 Sets the current technique.
 
virtual Materialclone () const
 returns a clone (deep-copy) of the material
 
void setPrimitiveType (ax::backend::PrimitiveType primitive)
 Set material primitive draw type.
 
ax::backend::PrimitiveType getPrimitiveType () const
 Get material primitive draw type.
 
void setTransparent (bool value)
 Enable material transparent rendering.
 
bool isTransparent () const
 Is material transparent?
 
void setForce2DQueue (bool value)
 Enable material 2D queue rendering.
 
bool isForce2DQueue () const
 Is material in 2D render queue?
 
- Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Objectautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static MaterialcreateWithFilename (std::string_view path)
 Creates a Material using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
 
static MaterialcreateWithProgramState (backend::ProgramState *programState)
 Creates a Material with a GLProgramState.
 
static MaterialcreateWithProperties (Properties *materialProperties)
 Creates a material from the specified properties object.
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 

Detailed Description

Member Function Documentation

◆ createWithFilename()

static Material * createWithFilename ( std::string_view path)
static

Creates a Material using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).

Parameters
urlThe URL pointing to the Properties object defining the material.
Returns
A new Material or NULL if there was an error.

◆ createWithProgramState()

static Material * createWithProgramState ( backend::ProgramState * programState)
static

Creates a Material with a GLProgramState.

It will only contain one Technique and one Pass. Added in order to support legacy code.

◆ createWithProperties()

static Material * createWithProperties ( Properties * materialProperties)
static

Creates a material from the specified properties object.

Parameters
materialPropertiesThe properties object defining the material (must have namespace equal to 'material').
Returns
A new Material.

◆ getTechniqueByName()

Technique * getTechniqueByName ( std::string_view name)

Returns a Technique by its name.

returns nullptr if the Technique can't be found.

◆ getTechniqueByIndex()

Technique * getTechniqueByIndex ( ssize_t index)

Returns a Technique by index.

returns nullptr if the index is invalid.

◆ setPrimitiveType()

void setPrimitiveType ( ax::backend::PrimitiveType primitive)
inline

Set material primitive draw type.

Parameters
primitivePrimitive draw type

◆ getPrimitiveType()

ax::backend::PrimitiveType getPrimitiveType ( ) const
inline

Get material primitive draw type.

Returns
Primitive draw type

◆ setTransparent()

void setTransparent ( bool value)

Enable material transparent rendering.

WARNING: depth testing will not work.


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