manualRender alternative

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
Archangel
Greenskin
Posts: 101
Joined: Sun Dec 19, 2004 6:02 pm
Location: Nantes, France
Contact:

manualRender alternative

Post 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).
Arch. / Kalith
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Re: manualRender alternative

Post by sinbad »

The solution really is to drive RenderSystem directly if you want to have low-level stateful render behaviour.
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Re: manualRender alternative

Post by nullsquared »

Yeah, use Ogre::RenderSystem::_render
User avatar
Archangel
Greenskin
Posts: 101
Joined: Sun Dec 19, 2004 6:02 pm
Location: Nantes, France
Contact:

Re: manualRender alternative

Post by Archangel »

Didn't know about this one...
Great, thanks :)
Arch. / Kalith
Post Reply