Linux/Windows build fixes

Here are some fixes to make it build on Linux and Windows (32-bit/64-bit).

What puzzles me a bit though is why a linked context was used for OSX. Was this a concious choice, or a very quick and dirty hack?

Just getting garbage image here on Linux still when #ifdeffing out the OSX hacks.
Probably some GL context status that's being handled poorly by Rice or something.