enabled OpenGL on MacOSX
some more fixes
Merge pull request #2329 from ilya-lavrenov:macosx_ogl