|
GUInity
|
#include <Material.hpp>
Public Types | |
| typedef pair< string, shared_ptr< Texture > > | StringTexPair |
| typedef pair< string, glm::vec4 > | StringVec4Pair |
Public Member Functions | |
| Material () | |
| Material (shared_ptr< Shader > s) | |
| virtual | ~Material () |
| void | setShader (shared_ptr< Shader > shader) |
| shared_ptr< Shader > | getShader () const |
| GLuint | getShaderProgram () |
| bool | paramExists (string paramName) |
| void | setParamVec4 (string paramName, const glm::vec4 ¶mValue) |
| void | setParamFloat (string paramName, float paramValue) |
| void | setParamTexture (string paramName, shared_ptr< Texture > paramValue) |
| vector< StringTexPair > | getAllTextureParams () |
| vector< StringVec4Pair > | getAllVec4Params () |
Public Member Functions inherited from Asset | |
| Asset () | |
| virtual | ~Asset () |
| void | setAssetID (unsigned int newAssetID) |
| unsigned int | getAssetID () const |
| string | getPath () |
| void | setPath (string newPath) |
| void | setName (string name) |
| string | getName () |
| void | setCRC (int crc) |
| int | setCRC () |
Material is an Asset that allows the same shader to be used several times with different parameters. For example, a Textured Diffuse Shader could be use for both a crate and the floor, the only thing that changes is the Texture.
Currently, the only parameter supported by Shaders and therefore Materials is the Texture type.
| Material::Material | ( | ) |
Default Constructor
|
virtual |
Default Destructor. Virtual because inherits from Asset
| vector< Material::StringTexPair > Material::getAllTextureParams | ( | ) |
Gets all Texture params
| vector< Material::StringVec4Pair > Material::getAllVec4Params | ( | ) |
Gets all Vec4 params
Gets all Vec3 params
| shared_ptr< Shader > Material::getShader | ( | ) | const |
shader Getter
| GLuint Material::getShaderProgram | ( | ) |
Get the shader program
| bool Material::paramExists | ( | string | paramName | ) |
Checks if param exists on params map
| void Material::setParamFloat | ( | string | paramName, |
| float | paramValue | ||
| ) |
Set a float param that has name paramName
| void Material::setParamTexture | ( | string | paramName, |
| shared_ptr< Texture > | paramValue | ||
| ) |
Set a Texture param that has name paramName
| void Material::setParamVec4 | ( | string | paramName, |
| const glm::vec4 & | paramValue | ||
| ) |
Set a vec4 param that has name paramName
| void Material::setShader | ( | shared_ptr< Shader > | shader | ) |
shader Setter
1.8.9.1