Public Member Functions

Tiny2D::Material Class Reference

Material instance with support for techniques and shaders. More...

#include <Tiny2D.h>

List of all members.

Public Member Functions

 Material ()
 Constructs an empty material.
 Material (const Material &other)
 Copy constructor; internally creates new material instance object (with custom set of material parameter values) and increases reference count of the material resource.
 ~Material ()
 Destroys material.
ResourceState GetState () const
 Gets resource state.
void operator= (const Material &other)
 Copy operator; internally creates new material instance object (with custom set of material parameter values) and increases reference count of the material resource.
bool operator== (const Material &other) const
 Equality operator.
bool operator!= (const Material &other) const
 Inequality operator.
bool Create (const std::string &name, bool immediate=true)
 Creates material from a material file; expects name.material.xml file to be present; 'immediate' set to true indicates to load it synchronously.
void Destroy ()
 Destroys material.
int GetTechniqueIndex (const std::string &name)
 Gets index of the technique within material or -1 if not found.
void SetTechnique (int index)
 Sets current technique by index.
void SetTechnique (const std::string &name)
 Sets current technique by name.
int GetParameterIndex (const std::string &name)
 Gets material parameter index or -1 if not found.
void SetIntParameter (int index, const int *value, int count=1)
 Sets integer parameter by index.
void SetIntParameter (const std::string &name, const int *value, int count=1)
 Sets integer parameter by name.
void SetFloatParameter (int index, const float *value, int count=1)
 Sets float parameter by index.
void SetFloatParameter (const std::string &name, const float *value, int count=1)
 Sets float parameter by name.
void SetFloatParameter (int index, float value)
 Sets single float parameter by index.
void SetFloatParameter (const std::string &name, float value)
 Sets single float parameter by value.
void SetTextureParameter (int index, Texture &value, const Sampler &sampler=Sampler::Default)
 Sets texture parameter by index.
void SetTextureParameter (const std::string &name, Texture &value, const Sampler &sampler=Sampler::Default)
 Sets texture parameter by name.
void Draw (const Shape::DrawParams *params)
 Draws shape described using given parameters using current technique with currently set parameters.
void DrawFullscreenQuad ()
 Draws fullscreen quad using current technique with currently set parameters.

Detailed Description

Material instance with support for techniques and shaders.


Constructor & Destructor Documentation

Tiny2D::Material::Material (  )

Constructs an empty material.

Tiny2D::Material::Material ( const Material other )

Copy constructor; internally creates new material instance object (with custom set of material parameter values) and increases reference count of the material resource.

Tiny2D::Material::~Material (  )

Destroys material.


Member Function Documentation

bool Tiny2D::Material::Create ( const std::string &  name,
bool  immediate = true 
)

Creates material from a material file; expects name.material.xml file to be present; 'immediate' set to true indicates to load it synchronously.

void Tiny2D::Material::Destroy (  )

Destroys material.

void Tiny2D::Material::Draw ( const Shape::DrawParams params )

Draws shape described using given parameters using current technique with currently set parameters.

void Tiny2D::Material::DrawFullscreenQuad (  )

Draws fullscreen quad using current technique with currently set parameters.

int Tiny2D::Material::GetParameterIndex ( const std::string &  name )

Gets material parameter index or -1 if not found.

ResourceState Tiny2D::Material::GetState (  ) const

Gets resource state.

int Tiny2D::Material::GetTechniqueIndex ( const std::string &  name )

Gets index of the technique within material or -1 if not found.

bool Tiny2D::Material::operator!= ( const Material other ) const

Inequality operator.

void Tiny2D::Material::operator= ( const Material other )

Copy operator; internally creates new material instance object (with custom set of material parameter values) and increases reference count of the material resource.

bool Tiny2D::Material::operator== ( const Material other ) const

Equality operator.

void Tiny2D::Material::SetFloatParameter ( int  index,
const float *  value,
int  count = 1 
)

Sets float parameter by index.

void Tiny2D::Material::SetFloatParameter ( const std::string &  name,
float  value 
)

Sets single float parameter by value.

void Tiny2D::Material::SetFloatParameter ( const std::string &  name,
const float *  value,
int  count = 1 
)

Sets float parameter by name.

void Tiny2D::Material::SetFloatParameter ( int  index,
float  value 
)

Sets single float parameter by index.

void Tiny2D::Material::SetIntParameter ( int  index,
const int *  value,
int  count = 1 
)

Sets integer parameter by index.

void Tiny2D::Material::SetIntParameter ( const std::string &  name,
const int *  value,
int  count = 1 
)

Sets integer parameter by name.

void Tiny2D::Material::SetTechnique ( const std::string &  name )

Sets current technique by name.

void Tiny2D::Material::SetTechnique ( int  index )

Sets current technique by index.

void Tiny2D::Material::SetTextureParameter ( int  index,
Texture value,
const Sampler sampler = Sampler::Default 
)

Sets texture parameter by index.

void Tiny2D::Material::SetTextureParameter ( const std::string &  name,
Texture value,
const Sampler sampler = Sampler::Default 
)

Sets texture parameter by name.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines