Moire Screensaver Source

September 19, 2005

I'm not a big screensaver enthusiast per se, but one of my all time favorite screensavers is definitely Moire from the DirectX 8.1 SDK. It's simple yet visually striking, and it works seamlessly on multiple monitors. It's also hardware accelerated on each monitor without requiring a lot of video card horsepower or CPU time.

moire_screensaver.gif

One thing that always bugged me about Moire, though, was that it chose the same colors over and over. Every time it ran, it would cycle through the same exact color sequences, in the same order.

Well, after digging around (a lot) to find the DX 8.1 SDK that this sample is specific to, I came up with the C++ source for Moire. With the assistance of a coworker more versed in C++ than I, we managed to bundle Moire into a VS.NET 2003 C++ solution. Then I was able to hack in a more sophisticated random color algorithm with my completely negligible C++ coding skillz.

This solution compiles fine on any machine with VS.NET 2003 installed; no DirectX SDK is required. I've attached both the original, unmodified Moire from the SDK and our modified random color version. And if you don't feel like hacking on the source code, I put a binary up as well.

Posted by Jeff Atwood
6 Comments

Compiled just fine on my system. I ran a comparison between the two projects to see your changes. Nice work...and I can see the difference visually.

Brian Swiger on September 20, 2005 2:41 AM

Thanks for that.

One small note: we noticed that developers with the DX9 SDK installed can't compile this solution. Not sure why, exactly, but developers with no SDK installed (eg, plain XP installs) have no problems whatsoever compiling it.

So if you have the DX9 SDK installed you might have difficulty compiling this.

Jeff Atwood on September 20, 2005 8:09 AM

You've changed what was a neat but predictable screensaver into what is now my favorite piece of animated art on my screen. I really like it!

John L. on October 2, 2005 5:04 AM

Thanks John! I totally agree; I always loved the effect but hated the predictability! It's amazing how much more effective it is with the small random color change..

Jeff Atwood on October 6, 2005 2:55 AM

Try my MoireScreenSaver at jdmcox.com (C source is also there (about 200 lines))

Doug Cox on January 2, 2006 5:48 AM

Epileptics beware! *clutches his head*

Moi on January 16, 2009 12:29 PM

The comments to this entry are closed.