Dear All:
I get the image from the imageset and I want texture of the image. How I do this.
thans
ttom
image texture
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
When you load the imageset, the underlying imagery file loaded is copied into a texture. When referencing a CEGUI::Image on the imageset, you're accessing a small area of an existing, usually larger, texture.
If you want a texture containing a sub-rectangle of the larger whole imageset, you have to get the larger texture and perform the subrect copy yourself. If you just want the whole texture, that is slightly easier. In both cases the overall way you do this will depend upon the underlying renderer in use.
As an example, in OpenGL you might do something like this to access the underlying texture...
The approach for other rendering APIs is different, although similar, I hope this gives some ideas
CE
When you load the imageset, the underlying imagery file loaded is copied into a texture. When referencing a CEGUI::Image on the imageset, you're accessing a small area of an existing, usually larger, texture.
If you want a texture containing a sub-rectangle of the larger whole imageset, you have to get the larger texture and perform the subrect copy yourself. If you just want the whole texture, that is slightly easier. In both cases the overall way you do this will depend upon the underlying renderer in use.
As an example, in OpenGL you might do something like this to access the underlying texture...
Code: Select all
using namespace CEGUI;
Imageset* myImageset =
ImagesetManager::getSingleton().getImageset( "SomeImageset" );
Texture* cegui_tex = myImageset->getTexture();
GLuint gl_tex_id =
static_cast<OpenGLTexture *>(cegui_tex)->getOGLTexid();
//
// TODO: Perform API specific operations on gl_tex_id
//
...
The approach for other rendering APIs is different, although similar, I hope this gives some ideas

CE
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Bing [Bot] and 6 guests