void OgreRenderManager::doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { if (getManualRender()) { begin(); setManualRender(false); } if (_texture) { OgreTexture* texture = static_cast<OgreTexture*>(_texture); Ogre::TexturePtr texture_ptr = texture->getOgreTexture(); if (!texture_ptr.isNull()) { mRenderSystem->_setTexture(0, true, texture_ptr); mRenderSystem->_setTextureUnitFiltering(0, Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_NONE); } } OgreVertexBuffer* buffer = static_cast<OgreVertexBuffer*>(_buffer); Ogre::RenderOperation* operation = buffer->getRenderOperation(); operation->vertexData->vertexCount = _count; mRenderSystem->_render(*operation); ++ mCountBatch; }
void doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { if (getManualRender()) { begin(); setManualRender(false); } // ADDED if (!mVertexProgramNoTexture) initShaders(); if (_texture) { Ogre::Root::getSingleton().getRenderSystem()->bindGpuProgram(mVertexProgramOneTexture); Ogre::Root::getSingleton().getRenderSystem()->bindGpuProgram(mFragmentProgramOneTexture); } else { Ogre::Root::getSingleton().getRenderSystem()->bindGpuProgram(mVertexProgramNoTexture); Ogre::Root::getSingleton().getRenderSystem()->bindGpuProgram(mFragmentProgramNoTexture); } if (_texture) { OgreTexture* texture = static_cast<OgreTexture*>(_texture); Ogre::TexturePtr texture_ptr = texture->getOgreTexture(); if (!texture_ptr.isNull()) { mRenderSystem->_setTexture(0, true, texture_ptr); mRenderSystem->_setTextureUnitFiltering(0, Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_NONE); } } OgreVertexBuffer* buffer = static_cast<OgreVertexBuffer*>(_buffer); Ogre::RenderOperation* operation = buffer->getRenderOperation(); operation->vertexData->vertexCount = _count; mRenderSystem->_render(*operation); ++ mCountBatch; }