Waving Flag effect for MASM
By Mic, 2000


!!!! IMPORTANT !!!!
This program uses conditional MOVes and MMX and therefor requires a Pentium II
processor or greater to run (a Pentium Pro with MMX should also do the trick).
The program will check for MMX-support itself but there's no guarantee that a
processor can handle cmov:s just because it has MMX-instructions, so DON'T run
this program on earlier processors or other processors that doesn't support
cmov:s (I don't know if anything bad will happend, but why take the risk?).



This program "simulates" a waving flag by placing a number of points along three
sine-curves and drawing triangles between these points.
DirectDraw serves as the graphics-interface so DirectX is required (I think any
version will do).

You can change the flag-pattern by pressing 1,2,3..0.
Press F/G to toggle between flat-/gouraud-shading.
Press S to take a snapshot (will be saved as flag.bmp).
Press Esc to exit the program.

There are a number of things in the program that could be optimized:
 - Optimize the FPU code: Use singles instead of doubles, use only the
   fastest instructions, remove some unnessecary code etc.
 - Remove the real-time sine-calculations and use a look-up table instead.
 - Combine loops to save some jumps.
 - Perhaps use fixed-point instead of floating-point.

