This sample shows how to do fire using a simple particle system. It requires GLUT, which is included in the file; put the glut32.dll file in \windows\system32, or in the directory of the executable, if you don't already have it. It also requires the file msvcr71.dll, which is also included in the package.
All the goodness happens in content.cpp, where it creates a simple heightfield terrain, and initializes the particle system; then, for each frame, it updates the light (which is 1 unit above the base of the fire) to make it flicker, and updates all the particles using a simple Euler integrator, with upwards force.
The particles use an 8-frame texture animation, plus an alpha fade during the last frame.
You can move with arrow keys, and click-and-drag to rotate and pitch the camera.
Errata: The code that sets up the speed of the QueryPerformanceFrequency() fails if the performance frequency is faster than 2 billion ticks per second. This apparently happens on some newer chip set, CPU, and Windows version combinations, which apparently use RDTSC instead of the PCI timers. Look for the set-up of g_frequency, and change the cast to (long) to a cast to (unsigned __int64) to fix this problem.
If you find this program useful, by all means, use it in your own projects. All you have to do is hold me, the original author, free from responsibility and harmless from any claim resulting from your use of, or inability to use, this code in your program or programs of others. I release the code under Berkeley license, on the conditions that all copies retain this paragraph. Copyright 2004 Jon Watte, all rights reserved.