2010-11-11, 20:38
I'm in need of a widget which can display a texture which is stored in a memory buffer. I was looking at CGUIImage but it can only handle image files. As my buffer changes frequently I wanted to write my own CGUI widget which would handle all buffer updates and display them on the screen.
I see that the CBaseTexture class does have a method LoadFromMemory(). Unfortunately this method is not made available by CGUITextureBase. Instead CGUITextureBase relies on the texture manager to load textures from file. I could however create a derived class of CGUITexture and manually add my CTexture object to CGUITextureBase::m_texture. This of course does not seem to be the way CGUITextureBase was intended to be used. So what is the correct way of using a CTexture object which was loaded from memory within GUI elements? Do I have to write my own CGUITextureBase class or should I modify CGUITextureBase to allow textures being loaded from memory?
Which format does CBaseTexture::LoadFromMemory() expect? RGBA?
I see that the CBaseTexture class does have a method LoadFromMemory(). Unfortunately this method is not made available by CGUITextureBase. Instead CGUITextureBase relies on the texture manager to load textures from file. I could however create a derived class of CGUITexture and manually add my CTexture object to CGUITextureBase::m_texture. This of course does not seem to be the way CGUITextureBase was intended to be used. So what is the correct way of using a CTexture object which was loaded from memory within GUI elements? Do I have to write my own CGUITextureBase class or should I modify CGUITextureBase to allow textures being loaded from memory?
Which format does CBaseTexture::LoadFromMemory() expect? RGBA?