Hi,
I'm new to the engine and i know some thing but the XML worried me a lot.... How do i wrote them and use them in the engine?[/quote]
How do I use XML in Irrlicht?
ok
Thanks for that but now, how do I integrate tiny to Irrlicht?? 
Irrlicht has build in classes to handle XML:
I'm using this code to read configuration, this function is calles before createDevice
maybe this will help you
I'm using this code to read configuration, this function is calles before createDevice
Code: Select all
void CMainApp::readConfiguration(CONFIGURATION& rConfig)
{
// Create
IReadFile* pFile = createReadFile( "App.xml" );
if ( !pFile )
throw new CAppException( TEXT_MISSING_CONFIG_FILE );
// Create
CTextReader* pTxtReader = new CTextReader( pFile );
IXMLReader* pkXML = new CXMLReader( pTxtReader );
// Drop
pTxtReader->drop();
pFile->drop();
// Set std configuration
rConfig.eDriverType = video::EDT_SOFTWARE;
rConfig.iWidth = 640;
rConfig.iHeight = 480;
rConfig.bFullscreen = false;
rConfig.iDepth = 16;
// Check
if ( !pkXML )
throw new CAppException( TEXT_MISSING_CONFIG_FILE );
// Read
while( pkXML && pkXML->read() )
{
// Check
switch( pkXML->getNodeType() )
{
case io::EXN_ELEMENT:
{
// Check
if ( stringw( L"Driver" ) == pkXML->getNodeName() )
{
stringw strValue = pkXML->getAttributeValue( L"Type" );
if (strValue == stringw( L"DirectX9" ) )
rConfig.eDriverType = video::EDT_DIRECTX9;
else
if (strValue == stringw( L"DirectX8" ) )
rConfig.eDriverType = video::EDT_DIRECTX8;
else
if (strValue == stringw( L"OpenGL" ) )
rConfig.eDriverType = video::EDT_OPENGL;
else
rConfig.eDriverType = video::EDT_SOFTWARE;
}
else if ( stringw( L"Screen" ) == pkXML->getNodeName() )
{
// Copy values
rConfig.iHeight = pkXML->getAttributeValueAsInt( L"Height" );
rConfig.iWidth = pkXML->getAttributeValueAsInt( L"Width" );
rConfig.iDepth = pkXML->getAttributeValueAsInt( L"Depth" );
rConfig.bFullscreen = static_cast<bool>( pkXML->getAttributeValueAsInt( L"Full" ) );
}
}
break;
}
}
// Free XML reader
if ( pkXML )
pkXML->drop();
}