frames per second
frames per second
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.
peripherique is in that case a pointer to your irrlicht device.
irr::f32 fps = device->getVideoDriver()->getFPS();
irr::f32 fps = device->getVideoDriver()->getFPS();
YASS - Yet Another Space Shooter - www.yass-engine.de
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!
how do i display it on the screen
and i added the above code and i get this
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)
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)
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)