Re: [osg-users] How to get average frame rate after some amount of running time?

2010-01-05 Thread Robert Osfield
Hi Dat, On Mon, Dec 28, 2009 at 5:18 PM, Nguyen Tien Dat tienda...@gmail.com wrote: Thanks for your answer. But I still have some doubts here. When I load the model with osgviewer, and press key 's', it displays that the frame rate is only 34 fps. But in my application, the frame rate goes up

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-28 Thread Nguyen Tien Dat
Hi Robert, Thanks for your answer. But I still have some doubts here. When I load the model with osgviewer, and press key 's', it displays that the frame rate is only 34 fps. But in my application, the frame rate goes up to 60, which is kind of strange because I have some control inside the loop

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-24 Thread Nguyen Tien Dat
Yes, I doubt that this is the refresh rate of the monitor, not the real frame rate. How could I avoid the sync-to-vblank thing, so that I can have the actual frame rate? Thanks, Dat On Wed, Dec 23, 2009 at 2:33 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote: On 23/12/09 12:23 AM, Nguyen Tien

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-24 Thread Robert Osfield
Hi Dat, On Thu, Dec 24, 2009 at 4:09 PM, Nguyen Tien Dat tienda...@gmail.com wrote: Yes, I doubt that this is the refresh rate of the monitor, not the real frame rate. How could I avoid the sync-to-vblank thing, so that I can have the actual frame rate? It *is* the actual frame rate. This is

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-23 Thread Ulrich Hertlein
On 23/12/09 12:23 AM, Nguyen Tien Dat wrote: frameRate = (double)numOfFrame/(endTime - startTime); But it always gives me about 60fps. Did I make a mistake somehow? (startTime and endTime are in seconds already) 60Hz sounds like you are running with sync-to-vblank. /ulrich

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-22 Thread Nguyen Tien Dat
Dear Robert, Thank for your answer. One more question. Right now I have my code like this: numOfFrame = 0; startTime = time(NULL); while (!viewer.done()) { viewer.frame(); numOfFrame ++; } endTime = time(NULL); frameRate = (double)numOfFrame/(endTime - startTime); But it always gives me

Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-21 Thread Robert Osfield
Hi Dat, On Sun, Dec 20, 2009 at 8:26 PM, Nguyen Tien Dat tienda...@gmail.com wrote: Dear all, Could you tell me a way to get the average frame rate after, for example, 1 minute of running? The OSG itself doesn't give you this but it gives you all the tools to do it. You have an osg::Timer