Absolutely positioned root window does not work.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

EnigmaticProgrammer
Just popping in
Just popping in
Posts: 12
Joined: Mon May 21, 2012 12:23

Absolutely positioned root window does not work.

Postby EnigmaticProgrammer » Tue Jul 31, 2012 23:10

When I set my root window's position and size like this:

Code: Select all

        root->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
        root->setSize(CEGUI::UVector2(cegui_reldim(1.0f), cegui_reldim( 1.0f)));


It renders fine but when I set my position and size like this:

Code: Select all

        root->setPosition(CEGUI::UVector2(cegui_absdim(0), cegui_absdim( 0)));
        root->setSize(CEGUI::UVector2(cegui_absdim(640), cegui_absdim( 480)));


I don't see anything. Is this normal and why? How can I absolutely position the root window?

EDIT: Absolutely positioned anything does not work right. The offset in the UDim is a relative offset too! How do I absolutely position stuff?!

EnigmaticProgrammer
Just popping in
Just popping in
Posts: 12
Joined: Mon May 21, 2012 12:23

Re: Absolutely positioned root window does not work.

Postby EnigmaticProgrammer » Wed Aug 01, 2012 01:13

The documentation makes it clear that offset is a pixel offset but that is not at all how it is working. Please tell me what I am doing wrong?!

Figured it out. It was necessary to call notifyDisplaySizeChanged every frame since I am rendering to multiple windows with different sizes.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Absolutely positioned root window does not work.

Postby CrazyEddie » Wed Aug 01, 2012 07:57

It was necessary to call notifyDisplaySizeChanged every frame since I am rendering to multiple windows with different sizes.

By 'windows' you mean what we refer to as "host windows" right? The windows that contain the OpenGL rendered output, as opposed to CEGUI windows?

Calling notifyDisplaySizeChanged every frame will have a significant performance cost, especially if you have lots of fonts. There are probably use cases that exist where calling that is valid, perhaps yours is one of them, I do not know.

CE.

EnigmaticProgrammer
Just popping in
Just popping in
Posts: 12
Joined: Mon May 21, 2012 12:23

Re: Absolutely positioned root window does not work.

Postby EnigmaticProgrammer » Wed Aug 01, 2012 22:08

CrazyEddie wrote:
It was necessary to call notifyDisplaySizeChanged every frame since I am rendering to multiple windows with different sizes.

By 'windows' you mean what we refer to as "host windows" right? The windows that contain the OpenGL rendered output, as opposed to CEGUI windows?

Calling notifyDisplaySizeChanged every frame will have a significant performance cost, especially if you have lots of fonts. There are probably use cases that exist where calling that is valid, perhaps yours is one of them, I do not know.

CE.


Can I do multiple CEGUI instances so I only have to resize the instance for that one window? How would that work?

EDIT: Seems that you have been working on this. https://plus.google.com/105429998892856178718/posts/NC5vKP3TY4a

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Absolutely positioned root window does not work.

Postby CrazyEddie » Thu Aug 02, 2012 08:06

Hi,

You can't have multiple cegui instances, since we use lots of horrible singletons :?

EDIT: Seems that you have been working on this. https://plus.google.com/105429998892856 ... C5vKP3TY4a

We mentioned this explicitly in the first topic you posted :?

In the devel code, support for multiple GUIContexts is in and working, though currently this support gives you the default "screen" GUIContext, and other GUIContext objects can be created that target textures.

It's very hard to really advise things, because we have no idea what you're doing, the problems you're trying to solve, why you've chosen the approach you have chosen, etc, etc...

CE

EnigmaticProgrammer
Just popping in
Just popping in
Posts: 12
Joined: Mon May 21, 2012 12:23

Re: Absolutely positioned root window does not work.

Postby EnigmaticProgrammer » Thu Aug 02, 2012 09:35

I'm working on this: http://ovgl.org

Basically, a user of my API can create host windows then designate regions of a window as a render target and assign a camera to that render target which renders the scene from that view point. What I want is to allow users of my API to be able to add GUI to a render target and however they scale that render target the GUI will scale along with it.

EDIT: Seems like the latest version of CEGUI works a lot like my system. I'm trying to figure out how to create a context in the latest version of CEGUI but to do that I first need a RenderTarget. There does not seem to be any information about this yet. How do I go about creating a render target from an SFML window?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Absolutely positioned root window does not work.

Postby CrazyEddie » Fri Aug 03, 2012 07:51

EnigmaticProgrammer wrote:How do I go about creating a render target from an SFML window?

CrazyEddie wrote:though currently this support gives you the default "screen" GUIContext, and other GUIContext objects can be created that target textures.

What this means is that as the code stands as of this writing, you can't (or you would have to make your own class based of CEGUI::RenderTarget, create instances and manage them youself.

Obviously at release it would be nice to have something that allows - what is effectively - multiple OpenGL viewports in one window (which is pretty easy to add). I'm not sure about multiple host windows, I would need to run some test cases first to determine the best way to approach that.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests