Why window texture colour is differnt from the image?
Posted: Sun Aug 14, 2011 01:29
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.
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.