nec
21-09-2010 19:02:44
Hello,
I'm trying to do a minimap with a render box but i have some litlle problems.
here is the code i use to init the RB:
then i write in the texture with :
What i'm expecting is to have a fully red canvas (20x20 streched over the 80x80 renderbox) but the red square is in the top left corner of the render box. So my question is, does the texture can be stetched so the 20x20 red square to cover the entire render box?
Itryed all the createTexture options but none do this.
I'm trying to do a minimap with a render box but i have some litlle problems.
here is the code i use to init the RB:
...
m_pRenderBox->createTexture(20, 20, MyGUI::Canvas::TRM_PT_VIEW_REQUESTED, Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE, Ogre::PF_A8R8G8B8);
m_pRenderBox->setCoord(0, 0, 80, 80 );
...
then i write in the texture with :
...
// update de la minimap
m_pRenderBox->lock();
for(UInt x = 0 ; x < 20 ; x++)
{
for(UInt y = 0 ; y < 20 ; y++)
{
m_pImage->setPixel(x, y, Ogre::ColourValue::Red);
}
}
m_pRenderBox->unlock();
...
What i'm expecting is to have a fully red canvas (20x20 streched over the 80x80 renderbox) but the red square is in the top left corner of the render box. So my question is, does the texture can be stetched so the 20x20 red square to cover the entire render box?
Itryed all the createTexture options but none do this.