4

I've been writing a program based on the ScreenSnapshot 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.

Ilya
  • 342
  • 2
  • 10

1 Answers1

0

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...)

Yuji
  • 34,103
  • 3
  • 70
  • 88
  • Thanks a lot mate! That's very helpful. Actually I am interested in continuous screen capture, i.e. creating a movie of the screen. I found this Q/A: http://developer.apple.com/library/mac/#qa/qa1740/_index.html#//apple_ref/doc/uid/DTS40011007 but I can't seem to find any sample code. Do you know if there is any? – Ilya Jul 28 '11 at 15:53
  • That Q&A contains short snippets of the sample code, right? You can plug them in to a Cocoa template, and off you go. – Yuji Jul 28 '11 at 16:21
  • CGDisplayCreateImage aside, the fact that glReadPixels is no longer working means Apple has a bug in their driver right? – eodabash Jan 10 '12 at 00:26