ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > irrXML
forum topic indicator Read irr data from XML files
person icon
itzjac
Registered User
Quote
2007-08-06 22:59:37

Hi working friends, I'm using the irr XML parser built on the 1.3 version of the engine. I have multiple files that contain the position, resolution, size and booleans needed for an specific scene. My xml file looks like:

<?xml version="1.0"?>
<Configuration>
     <!-- Configuracion del Splash Screen -->
     <Engine>
          <DriverType type="OpenGL"/>
          <ScreenResolution res = "1024, 728"/>
          <Fullscreen value="True"/>
          <BitsperPixel value="32"/>
          <Stencilbuffer value="False"/>
          <Vsync value="True"/>

            <ParticleEffects value ="True"/>
     <Engine/>


</Configuration>



The trouble comes when reading the ScreenResolution attribute. I have built functions to that work, but recently I saw the io::IAttribute class with lots of  getAttributeValueAsXXX.  Does the irrXML parser include the posibility of read that kind of format as a irr variable (i.e.core::position2d<s32> ,...) using io::IAttribute? Here is my code (the code is inside a while loop):


switch(confApp->getNodeType())
    {

        case io::EXN_ELEMENT:
        {

            if(core::stringw("ScreenResolution") == confApp->getNodeName())
            {
                core::stringc cadena = confApp->getAttributeValue(L"res");
                cout<<"la cadena ScreenRes es:"<<cadena.c_str()<<endl;
                atributos->addPosition2d( cadena.c_str(),
                                        tempScreenRes);



            }

        }
        break;
    }


The applicaction crash when axecutoing the addPosition2d(...) function, is the addPosition2d usage correct?. Are there any other function to get irr values directly with the irrXML parser?  :)

person icon
eriseros
Registered User
Quote
2007-08-08 17:15:54

[justify]case io::EXN_ELEMENT:
        {

            if(core::stringw("ScreenResolution") == confApp->getNodeName())
            {
                core::stringc cadena = confApp->getAttributeValue("res");[/justify]



[size=18]And where did you declare your [color=red]tempScreenRes[/color]?[/size]


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |