Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scaling & glReadPixels



Hi,

Instead of getting a a verbatim copy of the frame-buffer by way of a copy using glReadPixels(), I would like rather, a scaled down version of frame-buffer image.
But! I would all my scaling handled by my GPU. Sound simple enough right?


I'm using the capture method exactly as it is in the old glGrab project Sample Code example. (was on the apple developer web-site... not there anymore?)

any ideas?

-----------
I've got something like this currently:
    CGLSetCurrentContext( glContextObj ) ;
    glReadBuffer(GL_FRONT);
    glGetIntegerv(GL_VIEWPORT, viewport);
    glFinish();				/* Finish all OpenGL commands */
    glPixelStorei(GL_PACK_ALIGNMENT, 4);	/* Force 4-byte alignment */
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
    glPixelStorei(GL_PACK_SKIP_ROWS, 0);
    glPixelStorei(GL_PACK_SKIP_PIXELS, 0);

    /*
     * By matching the framebuffer format, we can get the
     * data transferred to our buffer using DMA.
     */
    glReadPixels(0, 0, width, height,
                GL_BGRA,
                GL_UNSIGNED_INT_8_8_8_8_REV,
                [bitmap bitmapData]);



Thanks!
Simon.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.