Iíve written a small app form y amusement based on a code snipped I found in the net. They are Fireworks that can be outputted to a window of your choice.
To compile it successfully, you have to rebuild the objmem32 library due to a little change in the Park-Miller random algo. The rest of the files are included in the attached zip file.

Enjoy! 8)

Posted on 2006-07-21 01:02:50 by Biterider
I like the pretty lights :)

You should add some mouse-support... click-boom, click-boom, clickclickclick-BOOM! :p
Posted on 2006-07-21 03:35:10 by f0dder
Hi Biterider,

Looks nice!!

I have 30-33 fps, as well on my desktop as on my laptop, while they have quite different specifications.

I rebuilt the ObjMem32 library, as you instructed.
After rebuilding the Fireworks project my exe was 26 KB
The original exe file you included in the zip file was 16 KB.

Could it have anything to do with different versions of RadAsm we are using. Or what else could it be?

Friendly regards,
Posted on 2006-07-21 05:57:32 by mdevries
Posted on 2006-07-21 06:13:12 by JimmyClif

I have 30-33 fps, as well on my desktop as on my laptop, while they have quite different specifications.

I get ~30fps as well, with almost no CPU usage... I haven't looked at the source, but my guess is that he's put in some form of frame-rate limiter.
Posted on 2006-07-21 06:41:18 by f0dder

Yeah, he asked me and I suggested two ways to control framerate.. I'm wondering which one he implemented :)
Posted on 2006-07-21 06:48:48 by Homer
The target frame rate is 30 fps. The trick (thanks to Homer) is to measure the render time and sleep the remaining time until we have to render again. If the wait time is negative due to a slow CPU, we do nothing and the frame rate falls under the target.
I tested it with a slow 500MHz CPU and the app reaches the target with 80% of CPU usage.

About the file size, switch RadAsm project to release or use the make.bat file.


Posted on 2006-07-21 06:50:59 by Biterider
Very nice Biterider!
I get a steady 32fps, with almost no cpu usage on my home PC.
Posted on 2006-07-22 14:13:05 by rags
Interesting, the fps should NEVER exceed 30fps.
The implementation of framerate capping is not quite perfect, but it's pretty close.
I assume you're still relying on WM_TIMER?
That would explain the discrepancy - it's simply inaccurate.
The more accuracy you require from timer, the more it sucks.
This is a good example of a timed event where WM_TIMER, GetTickCount and other 'quick and easy' timer functions are not good enough.

Posted on 2006-07-24 11:52:55 by Homer
Hi Homer
As I described in the previous post, Iím measuring the rendering process using a StopWatch object. This object uses the QueryPerformanceXXX apis to perform his job.
The loss of precision has 2 sources, the measurement of the frame rate in the main application, which is done with a Windows timer and the Sleep api. Since the both have latency times, the frame rate is slidely above the target but good enough for this example  ;)

Posted on 2006-07-24 15:21:40 by Biterider
Ahuh, and it pretty :)
Who doesn't like eye-candy? :P
Posted on 2006-07-26 05:33:16 by Homer