[SOLVED]How to render windows in a specified order

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

shenhui
Just popping in
Just popping in
Posts: 10
Joined: Thu Feb 17, 2011 06:36

[SOLVED]How to render windows in a specified order

Postby shenhui » Tue Feb 22, 2011 09:04

Hello all,

We all know that CEGUI uses System::renderGUI() for rendering all of created windows.

Here I've created a root window and three frame window(win1, win2, win3), then I want to control the window render order by program. For example, sometime I want to render win2 first, then render win1, at the end render win3, in another time, I want to render win3 first then render win2, at the end render win3.

Is there any method to set the render sequence and implement this request by program ?

I use CEGUI 0.7.5.

Much appreciation for any help.

SHEN Hui.
Last edited by shenhui on Fri Feb 25, 2011 03:08, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How to render windows in a specified order

Postby Kulik » Tue Feb 22, 2011 09:54

Look into Window::setZOrderingEnabled, moveToFront, moveToBack, moveInFront and moveBehind

PS: Please don't post multiple times, it will just make us angry :wink:

shenhui
Just popping in
Just popping in
Posts: 10
Joined: Thu Feb 17, 2011 06:36

Re: How to render windows in a specified order

Postby shenhui » Tue Feb 22, 2011 11:44

Thanks for your reply, maybe I do not express clearly. What I want to do is to draw each window independently, and do not use renderGUI() function, then I can draw some other texture in the correct graphics layer, such as web browser texture.

Sorry for the inconvenience.

SHEN Hui.

shenhui
Just popping in
Just popping in
Posts: 10
Joined: Thu Feb 17, 2011 06:36

Re: [SOLVED]How to render windows in a specified order

Postby shenhui » Fri Feb 25, 2011 03:20

I just find the solution on this forum to solve this problem, the solution is firstly bind the texture on a static image control, then you may rearrange the display sequences of all the windows as you wish:

Steps:
------------------------------------------------------------------------------------------------------------------------------------------
/*1. create a static image control */
winMgr.createWindow(SKIN "/StaticImage", "ImageTexture") ;

/*2. create a CEGUI texture based on existing render system texture(m_pTexture), for example m_pTexture may be LPDIRECT3DTEXTURE8 or LPDIRECT3DTEXTURE9 */
CEGUI::Texture* pCEGUITexture = &m_pD3DRender->createTexture(m_pTexture) ;

/*3. create a new image set and bind it on the CEGUI texture */
CEGUI::Imageset* pCEGUIImageset= &ImagesetManager::getSingleton().create("ImagesetName", *pCEGUITexture) ;

/*4. define a image based on new created image set */
pCEGUIImageset->defineImage("ImageName", CEGUI::Point(0.0f, 0.0f), CEGUI::Size(512, 512), CEGUI::Point(0.0f, 0.0f)) ;

/*5. set window property to bind texture on window */
winMgr.getWindow("ImageTexture")->setProperty("Image", "set:ImagesetName image:ImageName") ;
-----------------------------------------------------------------------------------------------------------------------------------------

Thanks for tedlin01 and his(her) thread(viewtopic.php?f=10&t=5315&p=25420&hilit=image+texture#p25420).

SHEN Hui.


Return to “Help”

Who is online

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