In carbon C, I’m trying to grab a rendered image in openGL into a Gworld using glReadPixels.
I know how to create the Gworld, draw into it with Quickdraw, make in current, etc.
The only thing I’m missing is how to copy the pixels from the openGL buffer into the Gworld, and therefore need the small portion of code to achieve this. Intense google search didn’t bring any useable example…
I managed to do it under Windows (with glReadPixels and a DIB) and wouldlike to achieve the same in MacOS.
I’ve found similar code on the Apple
developpers website, but I think it
concerns Carbon on MacOSX with the
AGL library.
But what about coding under MacOS 9 ?
Carbon is virtually identical on Mac OS X and Mac OS 9 (that is, after all, the point of Carbon).
The only thing in my texture code I linked to above that doesn’t work on Mac OS 9 is FSPathMakeRef. Everything else (QTNewGWorldFromPtr, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV) works identically on Mac OS 9.