本文整理汇总了C++中xml::Element::NextSiblingElement方法的典型用法代码示例。如果您正苦于以下问题:C++ Element::NextSiblingElement方法的具体用法?C++ Element::NextSiblingElement怎么用?C++ Element::NextSiblingElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Element
的用法示例。
在下文中一共展示了Element::NextSiblingElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _analyzeXML
//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
void LNFXManager::_analyzeXML( const char* xml, size_t size )
{
XML::Document xmlDoc;
xmlDoc.Parse( xml, size );
// まずは Technique → Pass と作成して、コンパイルする。この中で Variable も作る
XML::Element* xmlElement = xmlDoc.FirstChildElement();
while ( xmlElement != NULL )
{
// <Technique>
if ( strcmp( xmlElement->Name(), TechniqueElementName ) == 0 ) {
_analyzeXMLTechniqueElement( xmlElement );
}
xmlElement = xmlElement->NextSiblingElement();
}
// 次に、作成済みの Variable にアノテーションを割り振る
xmlElement = xmlDoc.FirstChildElement();
while ( xmlElement != NULL )
{
// <Variable>
if ( strcmp( xmlElement->Name(), VariableElementName ) == 0 ) {
_analyzeXMLVariableElement( xmlElement );
}
xmlElement = xmlElement->NextSiblingElement();
}
}
示例2: _analyzeXMLVariableElement
//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
void LNFXManager::_analyzeXMLVariableElement( XML::Element* xmlElement )
{
// 属性
const char* attrName = xmlElement->Attribute( NameAttributeName );
const char* attrSemantic = xmlElement->Attribute( SemanticAttributeName );
const bool attrShared = xmlElement->BoolAttribute( SharedAttributeName );
const char* attrTexture = xmlElement->Attribute(TextureAttributeName);
LN_THROW_InvalidFormat(attrName);
// 適用試行
IAnnotatedObject* var = mBuilder->OnTrySetVariableParam( attrName, attrSemantic, attrShared, attrTexture );
if ( var != NULL )
{
// 子要素
XML::Element* xmlChild = xmlElement->FirstChildElement();
while ( xmlChild != NULL )
{
// <Annotation>
if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
_analyzeXMLAnnotationElement( xmlChild, var );
}
xmlChild = xmlChild->NextSiblingElement();
}
}
}
示例3: _analyzeXMLPassElement
//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
void LNFXManager::_analyzeXMLPassElement( XML::Element* xmlElement, IAnnotatedObject* parentTech )
{
// 属性
const char* attrName = xmlElement->Attribute(NameAttributeName);
LN_THROW_InvalidFormat(attrName);
IAnnotatedObject* pass = mBuilder->OnCreatePass( parentTech, attrName );
// 子要素
XML::Element* xmlChild = xmlElement->FirstChildElement();
while ( xmlChild != NULL )
{
// <VertexShader>
if ( strcmp( xmlChild->Name(), VertexShaderElementName ) == 0 ) {
attrName = xmlChild->Attribute( EntryPointAttributeName );
GLSLCode* code = _findShaderCode(attrName);
LN_THROW_InvalidFormat(code);
mBuilder->OnCreateVertexShader( pass, code->Code.c_str(), code->Code.size() );
}
// <PixelShader>
else if ( strcmp( xmlChild->Name(), PixelShaderElementName ) == 0 ) {
attrName = xmlChild->Attribute( EntryPointAttributeName );
GLSLCode* code = _findShaderCode(attrName);
LN_THROW_InvalidFormat(code);
mBuilder->OnCreatePixelShader( pass, code->Code.c_str(), code->Code.size() );
}
// <RenderState>
else if ( strcmp( xmlChild->Name(), RenderStateElementName ) == 0 ) {
attrName = xmlChild->Attribute(NameAttributeName);
LN_THROW_InvalidFormat(attrName);
const char* value = xmlChild->Attribute( ValueAttributeName );
mBuilder->OnSetRenderState( pass, attrName, value );
}
// <Annotation>
else if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
_analyzeXMLAnnotationElement( xmlChild, pass );
}
xmlChild = xmlChild->NextSiblingElement();
}
// link
mBuilder->OnEndPass( pass );
}
示例4: _analyzeXMLTechniqueElement
//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
void LNFXManager::_analyzeXMLTechniqueElement( XML::Element* xmlElement )
{
// 属性
const char* attrName = xmlElement->Attribute( NameAttributeName );
LN_THROW_InvalidFormat(attrName);
IAnnotatedObject* tech = mBuilder->OnCreateTechnique( attrName );
// 子要素
XML::Element* xmlChild = xmlElement->FirstChildElement();
while ( xmlChild != NULL )
{
// <Pass>
if ( strcmp( xmlChild->Name(), PassElementName ) == 0 ) {
_analyzeXMLPassElement( xmlChild, tech );
}
// <Annotation>
else if ( strcmp( xmlChild->Name(), AnnotationElementName ) == 0 ) {
_analyzeXMLAnnotationElement( xmlChild, tech );
}
xmlChild = xmlChild->NextSiblingElement();
}
}