Hi,
I want to draw images created from the window texture to screen, and my steps are as follows: (version: CEGUI 0.7,5)
1. create a window "xxxx" which uses a transparency picture as its background.
2. create an image from this window's texture
Image image = ....
Window* pWindow = WindowManager::getSingleton().getWindow("xxxx");
RenderingSurface* pRS = &pWindow->getTargetRenderingSurface();
RenderingWindow* pRW = static_cast<RenderingWindow*>(pRS);
TextureTarget* pTT = &pRW->getTextureTarget ();
Texture* pTexture = pTT->getTexture();
Imageset* pImageset = &ImagesetManager::getSingleton().create("test", *pTexture);
pImageset->defineImage(); //image
3. draw this image to the GeometryBuffer
image.draw(*pGeometryBuffer, Rect(0, 0, width, height), 0);
4. call pGeometryBuffer->draw to draw the image to screen
The question is, the image colour GeometryBuffer draws is different from the window's background colour.
And I found the problem maybe come from the alpha blend, is there any method to resolve it ?? thanks
Sorry for my buggy english.
Why window texture colour is differnt from the image?
Moderators: CEGUI MVP, CEGUI Team
Re: Why window texture colour is differnt from the image?
1. I am not sure how you managed to post this in the General Discussion forum, given it is at the bottom of the index page, but this belongs in Beginners Help. Please try to post in the appropriate sub-forums.
2. Please make sure you surround all code segments with [code][/code] tags as it makes reading your code easier.
3. I assume it is not rendering correctly because you are drawing things out of order by manually calling GeometryBuffer::draw. Typically drawing is handled automatically via CEGUI::System::renderGUI(); this sets the appropriate render states and draws windows in the appropriate order. I think that if you just use Imageset::defineImage properly and then assign the image back to the "xxxx" window via Window::setProperty and let CEGUI handle drawing it would render correctly.
2. Please make sure you surround all code segments with [code][/code] tags as it makes reading your code easier.
3. I assume it is not rendering correctly because you are drawing things out of order by manually calling GeometryBuffer::draw. Typically drawing is handled automatically via CEGUI::System::renderGUI(); this sets the appropriate render states and draws windows in the appropriate order. I think that if you just use Imageset::defineImage properly and then assign the image back to the "xxxx" window via Window::setProperty and let CEGUI handle drawing it would render correctly.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Who is online
Users browsing this forum: No registered users and 15 guests