mostly untested opengl crazyness, win32 completely untested