Mailing Lists: Apple Mailing Lists

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

How to fix glGrab.c for Intel machines? (Was: Re: Fast screen shots for VNC like functionality...)



-- originally posted a few days ago, but now changed the title to better match the question

Hi Mike,

At 9:26 -0700 26/4/06, Mike Paquette wrote:
OpenGL can help here, as it includes the ability to convert pixel formats, and can even deal with hardware-specific pixel reading problems such as microtiling, or getting the correct framebuffer when full screen buffer swapping (the GL version of page flipping) is in effect. OpenGL will also use a DMA transfer for reading the framebuffer content, where available.

OpenGL provides both a synchronous read path suitable for simple screen captures using glReadPixels, and a fast asynchronous path using the texture read mechanism, which is a bit more complex, but works well for repeated capture operations, such as screencasting or recording a movie from the screen.

Here's a simple mechanism that can be used to read a rectangle from a display to a CGImageRef, as an example to help you get started. It's more comment than code:

Your code sample works pretty well, except for one thing. On Intel machines the colors look pretty awkward. I am sure some swapping needs to take place, but not being a quartz/opengl specialist, I am not sure what the best approach would be. Would you mind indicating what would need to be done to make the sample code work correctly on both Intel and PowerPC?


Thanks,

david.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/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.