frames per second

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

frames per second

Post 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.
AmigaIrr
Posts: 94
Joined: Mon Jan 10, 2005 7:55 am
Location: France, Alsace

Post by AmigaIrr »

fps = peripherique->getVideoDriver()->getFPS();
L'eternité c'est long, surtout vers la fin...

Q6600 triton 79, 4 GO, 2* RAPTOR 150GO of ARECA 256 RAID 0, 3870 Zalmann, P5K. 24" Samsung. Antec nine hundred
Guest

Post by Guest »

english please is that periphial?
Ronin
Posts: 116
Joined: Wed Mar 03, 2004 6:23 pm
Location: Germany

Post by Ronin »

peripherique is in that case a pointer to your irrlicht device.

irr::f32 fps = device->getVideoDriver()->getFPS();
YASS - Yet Another Space Shooter - www.yass-engine.de
SARIN
Posts: 139
Joined: Fri Oct 29, 2004 3:53 am

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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!
Image Image Image
Guest

Post 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)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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)
Image Image Image
Guest

Post 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
Post Reply