mono/MonoGame — pull request #2485 by RayBatts (2014-05-07 18:07:25+00:00)
Title: FreeImage TextureImporter Support

This PR addresses https://github.com/mono/MonoGame/issues/2478.

On Windows platforms, we're now using the FreeImage library to import image files. This adds support for a LOT of different image file types, most notably .dds files. http://freeimage.sourceforge.net/features.html

FreeImage is multiplatform, but this PR only addresses Windows. I'll leave Linux and OSX for people that can properly build and test against it.

At the moment, the Texture Importer/Processors and a couple of other related classes (Such as fonts) are implemented System.Drawing.Bitmap. In order to quickly add this feature and preserve functionality, we're using FreeImage to import the image, then passing a System.Drawing.Bitmap through the system. Eventually the goal is to stop using the System.Drawing library and replace its functionality with that of FreeImage. There are several wins there.

We also noticed a problem in Texture.GetPitch(). The fix was accidentally committed and added to this pull request, though it's still valid.