evilrat wrote:well, some kind of.
geometry buffer has method GeometryBuffer::getActiveTexture() which return Texture (struct?) ptr, this ptr, i think, you could feed to loadFromMemory method of OgreTexture which perform some data copying related to ogre.
I look into the API GeometryBuffer::getActiveTexture(), and is confused by
Code: Select all
Return a pointer to the currently active Texture object. This may return 0 if no texture is set
What is "the currently active Texture object" means ? Is it the texture of the window I am using to draw on screen?
Is it like:
I have a imageset -> a image from the imageset -> create a window using the image -> the window is a texture, and saved to buffer -> so if I call getActiveTexture(), I get the texture with a window draw on it, and the texture is called ActiveTexture?
Am I thinking it right?
And for the code, I was original thinking of:
Code: Select all
//create a texture, cast to OgreTexture
CEGUI::Texture &guiTex = CEGUI::OgreRenderer->createTexture();
CEGUI::OgreTexture &ogreTex = static_cast<CEGUI::OgreTexture&>(guiTex);
//a CEGUI::Window
Cegui::Window* pWnd = somewhereCreateACeguiWindow();
//get the buffer
GeometryBuffer &buf = pWnd->getGeometryBuffer();
//write the buffer to ogreTexture, so I have a ogreTexture with a window draw on it?
ogreTex->loadFromMemory(&buf , sizeof(buf), CEGUI::Texture::PF_RGBA);
But after your advice:
Code: Select all
//a CEGUI::Window
Cegui::Window* pWnd = somewhereCreateACeguiWindow();
//get the buffer
CEGUI::Texture* pGuiTex = pWnd->getGeometryBuffer().getActiveTexture();
//And just cast it to OgreTexture?
CEGUI::OgreTexture* pOgreTex = static_cast<CEGUI::OgreTexture*>(pGuiTex );
not sure why you want draw each window separately...
In game, character has name and health bar show on top of their head, using billboard(s).
I am trying to make it.
And because different character has different name text and health bar, using one cegui window is not enough.
So I need one CEGUI window to show on one Ogre billboard, as a name or health bar.
Thanks for help, very appreciate.
ps. My English is not good, either
![Wink :wink:](./images/smilies/icon_wink.gif)
Hope you can understand.