The problem occurs when I try to create an Ogre texture from CEGUI. Sorry the following is in python.
Code: Select all
cegui_texture = CEGUI.System.getSingleton().getRenderer().createTexture(self.textureName, self.videoSize)
The CEGUI:OgreTexture ctor always creates a 1x1 Ogre texture, on blitFromMemory it fails:
Code: Select all
OGRE EXCEPTION(2:InvalidParametersException): Destination box out of range in GL3PlusHardwarePixelBuffer::blitFromMemory at /media/sdb5/THISISITPYTHONOGRE/BRANCHES/v2-1/downloads/ogre/RenderSystems/GL3Plus/src/OgreGL3PlusHardwarePixelBuffer.cpp (line 126)
Segmentation fault (core dumped)
I tried updating the texture size. The blit doesn't fail but the texture is not displayed.
Code: Select all
texture = cegui_texture.getOgreTexture()
texture.freeInternalResources()
texture.setWidth(int(cegui_texture.getOriginalDataSize().d_width))
texture.setHeight(int(cegui_texture.getOriginalDataSize().d_height))
texture.setDepth(1)
texture.createInternalResources()
As a workaround I manually reset the Ogre texture after the above resize to ensure (d_size / d_dataSize) are the same.
Code: Select all
cegui_texture.setOgreTexture(cegui_texture.getOgreTexture(), False)
If I update OgreTexture(const String& name, const Sizef& sz) and createEmptyOgreTexture() to create a texture of size (sz) then I don't need the above, is there any reason the texture is not automatically created from the size passed in? Is there something else I am missing?
This is the basic image used to hold the texture. I invalidate all relevant windows and child windows after any texture updates.
Code: Select all
self.videoBasicImage = CEGUI.ImageManager.getSingleton().create("BasicImage", cegui_texture.getName())
self.videoBasicImage.setAutoScaled(CEGUI.ASM_Disabled )
rect = CEGUI.Rectf(CEGUI.Vector2f(0,0), cegui_texture.getOriginalDataSize())
self.videoBasicImage.setArea(rect)
self.videoBasicImage.setTexture(cegui_texture)