You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
In short - Irrlicht 1.5 is really, really outdated. Please update - we don't have the manpower to keep on backporting bugfixes into such old revisions.
OK, so I followed your advice and updated to version 1.7.2. Unfortunately the problem remains the same
But I think your problem is (if I understand you correct), that it also tries to read attributes for the parent? Which it shouldn't I guess.
That´s exactly what I assume, too.
Here is the updated callstack with new line-numbers, maybe you can have a look at it:
In short - Irrlicht 1.5 is really, really outdated. Please update - we don't have the manpower to keep on backporting bugfixes into such old revisions.
OK, so I followed your advice and updated to version 1.7.2. Unfortunately the problem remains the same :(
Ok, but at least you're now using a version where I no longer think it's an old bug which got fixed already. And it did change some checks for exactly that case since 1.5 - so I rather suspected this to be the problem. I hope you don't accidentally still link to the old version.
My problem now - I need a test to reproduce this. If you already have one to reproduce this it would help, otherwise you will have to wait until I find the time to write one.
Lol, you know you could simply have kicked out a few element from the xml? First get one working, then the next step ;-)
Anyway - the problem is the handling of the root-element of the xml. "irr_gui" can't be used when you serialize into another parent than the usual root (CGUIEnvironment is the usual root). But it seems it's already handled correctly when it has no attributes. So what you have to do is to remove the first attributes block - as that is serialization info for the skin which can only be used by CGUIEnvironment.
Also help yourself and set up a test-project where you can easy test such simple examples. The way I do is that I have one folder parallel to the irrlicht example folders for this. That folder works like the examples (I started by copying one) - so it has a Makefile and project files that just work with a single main.cpp. And each time I test something I name it main.cpp, copy it into that folder and can then do simple tests. And once it runs I rename the main.cpp in case I need it later again. Then you can do a quick-test if it really compiles&runs before asking others for help.
Lol, you know you could simply have kicked out a few element from the xml?
Surely, but I thought it might make sense if the behaviour would have been element-type-dependent.
So what you have to do is to remove the first attributes block
OK, that really solved that problem, now GUI is shown.
I´m still not sure which alignment-values I have to set for the child elements. I tried Left and Top-align to be upperLeft and the others to be scale or lowerRight, neither showed an effect. Do I have to set values for my root or different alignment-values for the childs? Do I maybe have to recalculate sizes and positions manually?
You have to set alignment values for the childs to tell them how they should behave when their parent is resized. So in your case whenever tex is resized all the elements in your xml will behave according to their alignment settings.
//our root
gui::IGUIStaticText *tex = GetGUIEnv()->addStaticText(L"", core::rect<s32>(0,0,1024,768));
tex->setVisible(true);
//load the gui file and use our root as parent
GetGUIEnv()->loadGUI(filepath.c_str(), tex);
//resize our root to the size our user wants to have
tex->setMaxSize(options.Screen);
tex->setMinSize(options.Screen);
Thanks a lot, CuteAlien for being so kind to help me
Instead of using setMaxSize+setMinSize for resizing you should use setRelativePosition. The other can do this as side-effect, but they are mainly here to work in combination with the alignment values. So you can say - resize with parent, but maximal up to setMaxSize. Or never make an element smaller than setMinSIze on resizing.