本文整理汇总了C++中PolycodeShaderModule::getShaderType方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeShaderModule::getShaderType方法的具体用法?C++ PolycodeShaderModule::getShaderType怎么用?C++ PolycodeShaderModule::getShaderType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeShaderModule
的用法示例。
在下文中一共展示了PolycodeShaderModule::getShaderType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: atoi
Shader *MaterialManager::createShaderFromXMLNode(TiXmlNode *node) {
Shader *retShader = NULL;
if(node->ToElement()->Attribute("type")) {
String shaderType = node->ToElement()->Attribute("type");
// Logger::log("Attempting to create %s shader\n", shaderType.c_str());
for(int m=0; m < shaderModules.size(); m++) {
PolycodeShaderModule *shaderModule = shaderModules[m];
if(shaderModule->getShaderType() == shaderType) {
retShader = shaderModule->createShader(node);
}
}
}
int numAreaLights = 0;
int numSpotLights = 0;
if(node->ToElement()->Attribute("numAreaLights")) {
numAreaLights = atoi(node->ToElement()->Attribute("numAreaLights"));
}
if(node->ToElement()->Attribute("numSpotLights")) {
numSpotLights = atoi(node->ToElement()->Attribute("numSpotLights"));
}
if(retShader) {
retShader->numAreaLights = numAreaLights;
retShader->numSpotLights = numSpotLights;
}
return retShader;
}
示例2: atoi
Shader *MaterialManager::createShaderFromXMLNode(TiXmlNode *node) {
TiXmlElement *nodeElement = node->ToElement();
if (!nodeElement) return NULL; // Skip comment nodes
Shader *retShader = NULL;
if(nodeElement->Attribute("type")) {
String shaderType = nodeElement->Attribute("type");
// Logger::log("Attempting to create %s shader\n", shaderType.c_str());
for(int m=0; m < shaderModules.size(); m++) {
PolycodeShaderModule *shaderModule = shaderModules[m];
if(shaderModule->getShaderType() == shaderType) {
retShader = shaderModule->createShader(node);
}
}
}
if (!retShader)
return NULL;
int numAreaLights = 0;
int numSpotLights = 0;
if(nodeElement->Attribute("numAreaLights")) {
numAreaLights = atoi(nodeElement->Attribute("numAreaLights"));
}
if(nodeElement->Attribute("numSpotLights")) {
numSpotLights = atoi(nodeElement->Attribute("numSpotLights"));
}
retShader->screenShader = false;
if(nodeElement->Attribute("screen")) {
if(String(nodeElement->Attribute("screen")) == "true") {
retShader->screenShader = true;
}
}
if(retShader) {
retShader->numAreaLights = numAreaLights;
retShader->numSpotLights = numSpotLights;
}
return retShader;
}
示例3:
Shader *MaterialManager::createShader(String shaderType, String name, String vpName, String fpName, bool screenShader) {
Shader *retShader = NULL;
for(int m=0; m < shaderModules.size(); m++) {
PolycodeShaderModule *shaderModule = shaderModules[m];
if(shaderModule->getShaderType() == shaderType) {
retShader = shaderModule->createShader(name, vpName, fpName);
}
}
if(retShader) {
retShader->screenShader = screenShader;
retShader->numAreaLights = 0;
retShader->numSpotLights = 0;
}
return retShader;
}