Page 1 of 1

[SOLVED]How to render windows in a specified order

Posted: Tue Feb 22, 2011 09:04
by shenhui
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.


Re: How to render windows in a specified order

Posted: Tue Feb 22, 2011 09:54
by Kulik
Look into Window::setZOrderingEnabled, moveToFront, moveToBack, moveInFront and moveBehind

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

Re: How to render windows in a specified order

Posted: Tue Feb 22, 2011 11:44
by shenhui
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.


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

Posted: Fri Feb 25, 2011 03:20
by shenhui
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:

/*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).