Basically...as the title says. If i wanted to retrieve the default one, all i need to do is call getDefaultGUIContext. By doing so i get a reference to the default one.
But there is no similar function for ones created manually. The only reference to them is given when you manually create them. And i need some way to retrieve it when i need to check for inputs or some other thing.
So...how am i supposed to work with them, design-wise?
Retrieve a non-default gui context[SOLVED]
Moderators: CEGUI MVP, CEGUI Team
Retrieve a non-default gui context[SOLVED]
Last edited by Jefferian on Fri Aug 30, 2013 09:33, edited 1 time in total.
Re: Retrieve a non-default gui context
You are supposed to store the reference yourself. GUI contexts don't have names so it would be problematic to retrieve them.
Re: Retrieve a non-default gui context
Kulik wrote:You are supposed to store the reference yourself. GUI contexts don't have names so it would be problematic to retrieve them.
And being a reference i can't simply have it as a class member of the state it belongs to - unlike a pointer. As it is created inside it, where a reference would have to be passed at initializiation to be a class member. Guess i've got to think of some other way to store it. Maybe a separate class to handle those context references.
Well, thanks for the reply.
Re: Retrieve a non-default gui context
Code: Select all
GUIContext* context = &CEGUI::System::getSingleton().createGUIContext();
You can store them as a class member if you do this in a ctor initialiser list.
Code: Select all
SomeClass::SomeClass():
mMyGUIContext(CEGUI::System::getSingleton().createGUIContext())
{}
Re: Retrieve a non-default gui context
Kulik wrote:Code: Select all
GUIContext* context = &CEGUI::System::getSingleton().createGUIContext();
You can store them as a class member if you do this in a ctor initialiser list.Code: Select all
SomeClass::SomeClass():
mMyGUIContext(CEGUI::System::getSingleton().createGUIContext())
{}
Uh, i was somehow convinced the first option wasn't actually feasible. Nice to see i was wrong, cause that's exactly what i needed. Thank you very much.
Who is online
Users browsing this forum: No registered users and 16 guests