Page 1 of 1

frames per second

Posted: Wed Sep 14, 2005 7:21 am
by Guest
how do i check frames per second in my exe code snippet pls i tried looking for it the classes couldnt find it...thx p.s. how do i optimize the fps.

Posted: Wed Sep 14, 2005 7:25 am
by AmigaIrr
fps = peripherique->getVideoDriver()->getFPS();

Posted: Wed Sep 14, 2005 8:52 am
by Guest
english please is that periphial?

Posted: Wed Sep 14, 2005 8:55 am
by Ronin
peripherique is in that case a pointer to your irrlicht device.

irr::f32 fps = device->getVideoDriver()->getFPS();

Posted: Wed Sep 14, 2005 2:57 pm
by SARIN
optimize? what do u mean? i can only think of 2 things
1. To "optimize" ur fps u gotta cut all unnecessary things, i dont no wat is in ur program so i cant do that for u
2. To "stabalize" ur fps u cant. unless u put in a pause function for every loop, which i find unneccessary myself

Posted: Wed Sep 14, 2005 4:13 pm
by JP
I had problems with my program lagging loads cos of the way i'd built my 3D maze, i'd used addTestSceneNode() to create the walls of the maze, but when i had a maze of 20x20 cells with floor and ceilings it was horribly lagged, now i've changed the way the maze is built, now using meshes, and actually cutting out some of the faces of the walls, ie the top and bottom faces of the walls which wouldn't actually be visible anyway and now it's completely lag free. Unfortunatly it's a rather complicated change to make and it's still causing me problems!

Posted: Thu Sep 15, 2005 5:06 am
by Guest
how do i display it on the screen
and i added the above code and i get this

Code: Select all

C:\Documents and Settings\Maxy\Desktop\exe\setup.cpp(28) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
C:\Documents and Settings\Maxy\Desktop\exe\setup.cpp(29) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

setup.obj - 0 error(s), 2 warning(s)

Posted: Thu Sep 15, 2005 10:08 am
by JP
Do you want to display the fps on screen? If you look at the tutorials then you can see how they do it, they do it in the loop where the device does all the drawing, changing the window caption to contain the current fps.

What you've got there is that you're using a float where you need an int (or vice versa) so rounding/truncation will occur, which will mean the accuracy of the number is lost. I don't know how C works but in java you'd just do a cast on the number (which would lose the accuracy but would stop the complier complaining)

Posted: Fri Sep 16, 2005 4:07 am
by Guest
k i got the code from the quake map example and it works ok in windowed mode a little timed delayed but hey what can you do? (can i fix that?) and i want it to show in full screen mode like the hello world caption i geuss its actually stati text. thx