|
-
Mar 22nd, 2002, 02:28 PM
#1
Thread Starter
New Member
Frames per second
I was wondering if it was possible to make a program in visual basic
that could measure framerates in directx and opengl. Such as the
program "fraps" http://www.fraps.com
Any ideas,suggestions, or comments would be greatly appreciated.
-
Mar 22nd, 2002, 06:51 PM
#2
Hyperactive Member
Look up the Win32 API's GetTickCount function. That should let you do it easily.
-
Mar 22nd, 2002, 08:18 PM
#3
Frenzied Member
that code should work, you need to declare the gettickcount api though
past that into your mainloop
Code:
global FPS as long
static FPStime as long
static frame as long
if FPStime +1000 < gettickcount
fps = frame
frame = 0
endif
frame = frame +1
Sanity is a full time job
Puh das war harter Stoff!
-
Mar 24th, 2002, 06:30 PM
#4
Thread Starter
New Member
Thanks for the help guys..
-
Mar 24th, 2002, 11:41 PM
#5
Here is a better code fragment:
Code:
Dim STime as Long
Dim ETime as Lonh
...
STime = GetTickCount()
'// do drawing and updating here...
ETime = GetTickCount()
Dim fps as Single
fps = 1000 / (ETime-STime)
Z.
-
Mar 25th, 2002, 06:45 AM
#6
PowerPoster
well the second will show you very different frame rates each time while the first one shows more average results.. I recommend (and use) the first one though
-
Apr 6th, 2002, 10:30 PM
#7
Thread Starter
New Member
thx again
Thank you again. I have one more question. I was wanting to find the frames per second in any direct x or d3d game i had running, not just my vb program. any suggestions?
-
Apr 9th, 2002, 05:11 AM
#8
PowerPoster
I'd say any 3D game supports showing the FPS rate.. in most cases you can directly show the rate on screen, in some games its logged in a log-file when exiting the game, differs... otherwise I don't see any way to get the FPS of running programs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|