From Farshid Lashkari, "Attached is a small patch that adds support for writing BGR images to the DDS plugin."

This commit is contained in:
Robert Osfield
2011-06-16 16:02:27 +00:00
parent 27d4d5e4b9
commit 22dd032faa

View File

@@ -782,6 +782,17 @@ bool WriteDDSFile(const osg::Image *img, std::ostream& fout)
SD_flags |= DDSD_PITCH;
}
break;
case GL_BGR:
{
ddpf.dwBBitMask = 0x000000ff;
ddpf.dwGBitMask = 0x0000ff00;
ddpf.dwRBitMask = 0x00ff0000;
PF_flags |= DDPF_RGB;
ddpf.dwRGBBitCount = pixelSize;
ddsd.lPitch = img->getRowSizeInBytes();
SD_flags |= DDSD_PITCH;
}
break;
case GL_LUMINANCE:
{
ddpf.dwRBitMask = 0x000000ff;