From 47ac20af40a8d322380e0e6d81a22812466e4666 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Aug 2015 22:28:59 +0200 Subject: [PATCH] Workaround flipped cursor on OS X --- components/sdlutil/sdlcursormanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 89928d165..70a159306 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -126,7 +126,13 @@ namespace glViewport(0, 0, width, height); +#if defined(__APPLE__) + // FIXME: why are the extra flips needed on Mac? glReadPixels bug? + osg::ref_ptr geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,1,0), osg::Vec3(2,0,0), osg::Vec3(0,-2,0)); +#else osg::ref_ptr geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,-1,0), osg::Vec3(2,0,0), osg::Vec3(0,2,0)); +#endif + geom->drawImplementation(renderInfo); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, resultImage->data());