Coding Horror

programming and human factors

Moire Screensaver Source

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.

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Exchange and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: http://twitter.com/codinghorror