Expose Root::mCurrentFrame

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Expose Root::mCurrentFrame

Post by syedhs »

As the title suggest, I would like to increment Root::mCurrentFrame manually. Maybe in the form of new method Root::_incrementFrameNumber(). The reason is since I dont use any FrameListener, I would like to skip calling _fireFrameStarted (which is called by renderOneFrame). So instead of calling Root::renderOneFrame, I would like to update my graphics loop to be like this:-

Code: Select all

mRoot->_incrementFrameNumber();
mRoot->_updateAllRenderTargets();
Well you know without incrementing the frame number, my animated entities dont get animated. :wink:
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Re: Expose Root::mCurrentFrame

Post by nullsquared »

syedhs wrote:As the title suggest, I would like to increment Root::mCurrentFrame manually. Maybe in the form of new method Root::_incrementFrameNumber(). The reason is since I dont use any FrameListener, I would like to skip calling _fireFrameStarted (which is called by renderOneFrame). So instead of calling Root::renderOneFrame, I would like to update my graphics loop to be like this:-

Code: Select all

mRoot->_incrementFrameNumber();
mRoot->_updateAllRenderTargets();
Well you know without incrementing the frame number, my animated entities dont get animated. :wink:
I just used to call _fireFrameStarted() and _fireFrameEnded(), which did the job (even though I didn't use frame listeners). Though now I just call renderOneFrame(), even though it does more "managing" than "rendering" - I update all of my render targets manually (SceneManager::_renderScene, actually).
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Re: Expose Root::mCurrentFrame

Post by syedhs »

nullsquared wrote:FrameStarted() and _fireFrameEnded(), which did the job (even though I didn't use frame listeners).
Actually that is what I am doing now, so the point is there are unnecessary (to app not using FrameListener) calculations done in _fireFrameStarted/Ended. Although the time taken maybe trivial, I wouldn't want to waste CPU cycle on those unnecessary calculations. :wink:
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
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:

Post by sinbad »

You must still call the _fireFrame* methods. There are internal Ogre workings that rely on this, so it doesn't matter if you don't have your own FrameListeners, if you're running your own loop you must still raise these events. Not optional ;)
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Ah I forgot that I did search addFrameListener (Ctrl+Shift+F) to search any Ogre dependence on FrameListener - looks like I am defeated. :wink:

Case closed.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
Post Reply