Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to fix glGrab.c for Intel machines? (Was: Re: Fast screen shots for VNC like functionality...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



At 10:00 -0500 25/5/06, Chilton Webb wrote:
Hi guys,

Just swap the alpha and blue channels. Problem solved.

I understand that there are bytes to be swapped, however, my question is what the best way would be, without loosing all the speed advantages of the glGrab.c Mike posted about a month ago. I am hoping there is a way without manually swapping those bytes :-)


david.

-Chilton

On Thursday, May 25, 2006, at 09:37AM, David Niemeijer <email@hidden> wrote:

-- 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:
This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to fix glGrab.c for Intel machines? (Was: Re: Fast screen shots for VNC like functionality...) (From: David Niemeijer <email@hidden>)
 >Re: How to fix glGrab.c for Intel machines? (Was: Re: Fast screen shots for VNC like functionality...) (From: Chilton Webb <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.