OpenGLScreenSnapshot doesn't work in Mac OS X 10.7 - Lion
I've been writing a program based on the ScreenSnapshot开发者_StackOverflow example from apple: http://developer.apple.com/library/mac/#samplecode/OpenGLScreenSnapshot/Introduction/Intro.html and after upgrading from Snow Leopard to Lion my program stopped working. When I checked the example I realized it is not working either. For some reason glReadPixels function raises the GL_INVALID_FRAMEBUFFER_OPERATION_EXT error (0x0506).
I have reinstalled developer's tools but no luck. Has anyone made any progress with this issue? Any pointers will be greatly appreciated.
An updated version was posted a few days ago, see this new sample code called ScreenSnapshot. There's now a dedicated fonction CGDisplayCreateImage. There's even an accompanying technical Q&A.
So, a more général answer: follow Apple's document révisions regularly. (Sorry for extraneous accents over é's or fonctions... somehow Lion's spell checker wants to be in French mode.. grr...)
精彩评论