Page 1 of 1

manualRender alternative

Posted: Mon May 18, 2009 2:09 pm
by Archangel
Hi there,

I've made my own GUI system, and I wanted to use manual rendering.
So, to draw some triangles on the screen I've used SceneManager::manualRender().
But look at the parameters :

Code: Select all

void SceneManager::manualRender(RenderOperation* rend, 
                                Pass* pass, Viewport* vp, const Matrix4& worldMatrix, 
                                const Matrix4& viewMatrix, const Matrix4& projMatrix, 
                                bool doBeginEndFrame) 
{
    // ...
}
What if you just want to use the viewport, the pass, and the matrices that are already in use ?
I need to call this function several times with the same viewport and the same matrices, so it is a waste of time to set them back every time I need to render something (for the viewport, it's not a big deal because Ogre checks if the change is necessary, but not for the matrices).

Solution : you could write a version where these arguments are optional, and when they are not provided, use "default" ones (those that were set before calling the function).

Re: manualRender alternative

Posted: Mon May 18, 2009 6:14 pm
by sinbad
The solution really is to drive RenderSystem directly if you want to have low-level stateful render behaviour.

Re: manualRender alternative

Posted: Mon May 18, 2009 8:05 pm
by nullsquared
Yeah, use Ogre::RenderSystem::_render

Re: manualRender alternative

Posted: Tue May 19, 2009 10:11 am
by Archangel
Didn't know about this one...
Great, thanks :)