Code: Select all
// Create RTT texture
Ogre::TexturePtr texture = TextureManager::getSingleton().createManual("Rtt", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 1024, 768, 0, Ogre::PF_R8G8B8A8, Ogre::TU_RENDERTARGET, 0, false, 16);
// some ro render then ...
// get bits from the texture
size_t tDepth = texture->getDepth();
Ogre::HardwarePixelBufferSharedPtr pixelBuffer = texture->getBuffer();
byte* pData = (byte*)(pixelBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
pixelBuffer->unlock();
my graphics card is GeoForce210 and it runs well on the Win7 with RenderSystem_GL,but I switch the rendersystem as RenderSystem_GLES2,it could not work on my computer,I am not sure about two points:
1.create the RTT in GLES2
i changed the format as R8G8B8,the texture is created well,could I think that the issue is about my graphics card that not support RGBA format?
i run it on another computer with graphics card geoforce gt 640,it also can not work.
2.how to get bits in GLES2
i debug the code and it says not support by OpenGL ES in the function GLES2TextureBuffer::download(const PixelBox &data),is there some ways else i can realise my purpose?
i hope someone can give me some suggestions,thanks very much.