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 FilterNone::doManualRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { #ifdef MYGUI_OGRE_PLATFORM if (OgreRenderManager::getInstancePtr()->getManualRender()) OgreRenderManager::getInstancePtr()->begin(); OgreRenderManager::getInstancePtr()->setManualRender(true); if (_texture) { OgreTexture* texture = static_cast<OgreTexture*>(_texture); Ogre::TexturePtr texture_ptr = texture->getOgreTexture(); if (!texture_ptr.isNull()) { OgreRenderManager::getInstancePtr()->getRenderSystem()->_setTexture(0, true, texture_ptr); OgreRenderManager::getInstancePtr()->getRenderSystem()->_setTextureUnitFiltering(0, Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_POINT); } } OgreVertexBuffer* buffer = static_cast<OgreVertexBuffer*>(_buffer); Ogre::RenderOperation* operation = buffer->getRenderOperation(); operation->vertexData->vertexCount = _count; OgreRenderManager::getInstancePtr()->getRenderSystem()->_render(*operation); #elif MYGUI_OPENGL_PLATFORM OpenGLRenderManager::getInstancePtr()->doRender(_buffer, _texture, _count); #elif MYGUI_DIRECTX_PLATFORM DirectXRenderManager::getInstancePtr()->doRender(_buffer, _texture, _count); #endif }
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; }