Material.
More...
#include <Material.h>
Inherits Object.
Inherited by MeshMaterial.
|
std::string | getName () const |
| returns the material name
|
|
void | setName (std::string_view name) |
| sets the material name
|
|
Technique * | getTechniqueByName (std::string_view name) |
| Returns a Technique by its name.
|
|
Technique * | getTechniqueByIndex (ssize_t index) |
| Returns a Technique by index.
|
|
Technique * | getTechnique () 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 Material * | clone () 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?
|
|
void | retain () |
| Retains the ownership.
|
|
void | release () |
| Releases the ownership immediately.
|
|
Object * | autorelease () |
| Releases the ownership sometime soon automatically.
|
|
unsigned int | getReferenceCount () const |
| Returns the Object's current reference count.
|
|
virtual | ~Object () |
| Destructor.
|
|
|
unsigned int | _ID |
| object id, ScriptSupport need public _ID
|
|
int | _luaID |
| Lua reference id.
|
|
◆ 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
-
url | The 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()
Creates a material from the specified properties object.
- Parameters
-
materialProperties | The properties object defining the material (must have namespace equal to 'material'). |
- Returns
- A new Material.
◆ getTechniqueByName()
Technique * getTechniqueByName |
( |
std::string_view | name | ) |
|
◆ 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
-
primitive | Primitive 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: