Hey there,
Â
I took a shot at compiling VBA-M on OS X 10.7.3 and noticed that the blue color channel seemed to be completely absent:
Â
Â
After some digging, I found out that the systemRed/Green/BlueShift were incorrect in that they didn't match what OpenGL expects when drawing GL_BGRA data. The miscalculation of the shifts is apparently caused by an oddity in SDL on OS X which seems to interpret the in the wrong endianess (maybe for backwards compatibility for software written for PowerPC??).
Â
I wrote a fix for the issue that can be found here (excuse the wrong indentation, in case you want to apply this to your codebase I will of course supply a clean patch /emoticons/smile@2x.png 2x" width="20" height="20" /> ).
What my change does is an additional byte order check (I took the code from "test/testgl.c" in the SDL sources) if OpenGL is enabled. The resulting shifts have to be shifted an additional byte so that they properly align with OpenGL's BGRA.
I also changed GL_UNSIGNED_BYTE to GL_UNSIGNED_INT_8_8_8_8 as suggested here in order to prevent further endianess issues.
Â
I tested the change on Ubuntu and OS X, but haven't tried it on Windows yet. I'm looking forward to some feedback and suggestions to improve the fix =)
Â
PS: I built VBA-M from the latest revision available in the SVN repo