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.
Thanks in advance,
Use QTNewGWorldFromPtr to create the GWorld. This lets you specify the pixel format (use k32ARGBPixelFormat) and provide the pointer to image memory.
Then you can call glReadPixels passing that pointer, GL_BGRA and GL_UNSIGNED_INT_8_8_8_8_REV.
Similar code (for uploading textures from GWorlds, but the principle’s the same) in QTValuePak: http://184.108.40.206/CVS/
[This message has been edited by OneSadCookie (edited 07-01-2003).]
Thanks for your reply.
I’ve found similar code on the Apple
developpers website, but I think it
concerns Carbon on MacOSX with the
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.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.