Demo8 integration into CEGUI Samples framework

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

cbuchner1
Just popping in
Just popping in
Posts: 6
Joined: Wed Sep 17, 2014 10:36

Demo8 integration into CEGUI Samples framework

Postby cbuchner1 » Wed Sep 17, 2014 10:42

I've made an attempt at integrating the Demo8 LUA scripting demo into the CEGUI samples framework again.
Currently it compiles, but crashes.

Currently I am stuck at the problem of passing the GUI context from Demo8Sample::initialise()
into the LUA script.

It seems the default GUI context that is used in the demo8.lua script is the one used for the sample selection
screen of the samples framework, but the individual samples all run in their individual contexts. The sample
browser then crashes because Demo8 doesn't set a root window in the sample's GUI context (the pointer
remains ULL).

Is there an easy method to pass arguments or user data into LUA scripts?

Christian

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Demo8 integration into CEGUI Samples framework

Postby Ident » Wed Sep 17, 2014 13:39

If you got that running that would be really great.
I dont use Lua so I cant help you much in detail.

What do you mean by "Is there an easy method to pass arguments or user data into LUA scripts?" though? Cant you call a getter function?
CrazyEddie: "I don't like GUIs"

cbuchner1
Just popping in
Just popping in
Posts: 6
Joined: Wed Sep 17, 2014 10:36

Re: Demo8 integration into CEGUI Samples framework

Postby cbuchner1 » Wed Sep 17, 2014 15:17

I am not aware of an existing getter function for named GUI contexts.

Currently the LUA script uses CEGUI.System:getSingleton():getDefaultGUIContext() which doesn't return the context I want.

I would like to avoid creating my own interface bindings just for this demo (and I have never before done
an interface between LUA and C++)

Christian

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Demo8 integration into CEGUI Samples framework

Postby Ident » Wed Sep 17, 2014 15:44

Ok now I understand what you mean. Let me look into it...
CrazyEddie: "I don't like GUIs"

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Demo8 integration into CEGUI Samples framework

Postby Ident » Wed Sep 17, 2014 16:03

No, there is in fact no way you can retrieve a created GUIContext directly via CEGUI. It is the user 's duty to handle the reference of the GUIContexts they created. As far as I know we dont plan to change this.

Therefore, I am afraid you will have to create a Lua function similar to the initialise function in C++, which has the GUIContext as parameter. It is just one function that is required for this. Maybe Martin (Kulik) is able to help you out with this when he has time. In case there will ever be multiple Lua samples, it might be great to have this binding create by a subclass of Sample, for example LuaSample, that inherits sample and does all the generic stuff already and calls some Lua function for you to put the initialisation code in. But I don't know if this is feasible.
CrazyEddie: "I don't like GUIs"


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests