RenderState can be part of Material and Technique

This commit is contained in:
Ricardo Quesada 2015-05-13 14:12:37 -07:00
parent 7bf550f38b
commit aeea7ade14
2 changed files with 15 additions and 5 deletions

View File

@ -133,9 +133,14 @@ bool Material::parseProperties(Properties* materialProperties)
while (space)
{
const char* name = space->getNamespace();
if (strcmp(name, "technique") == 0) {
if (strcmp(name, "technique") == 0)
{
parseTechnique(space);
}
else if (strcmp(name, "renderState") == 0)
{
parseRenderState(this, space);
}
space = materialProperties->getNextNamespace();
@ -161,9 +166,14 @@ bool Material::parseTechnique(Properties* techniqueProperties)
while (space)
{
const char* name = space->getNamespace();
if (strcmp(name, "pass") == 0) {
if (strcmp(name, "pass") == 0)
{
parsePass(technique, space);
}
else if (strcmp(name, "renderState") == 0)
{
parseRenderState(this, space);
}
space = techniqueProperties->getNextNamespace();
}
@ -371,9 +381,9 @@ bool Material::parseUniform(GLProgramState* programState, Properties* properties
}
bool Material::parseRenderState(Pass* pass, Properties* properties)
bool Material::parseRenderState(RenderState* renderState, Properties* properties)
{
auto state = pass->getStateBlock();
auto state = renderState->getStateBlock();
auto property = properties->getNextProperty();
while (property)

View File

@ -134,7 +134,7 @@ protected:
bool parseSampler(Pass* pass, Properties* properties);
bool parseShader(Pass* pass, Properties* properties);
bool parseUniform(GLProgramState* programState, Properties* properties, const char* uniformName);
bool parseRenderState(Pass* pass, Properties* properties);
bool parseRenderState(RenderState* renderState, Properties* properties);
// material name