Mailing Lists: Apple Mailing Lists

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

Re: "DisposeGWorld is deprecated"




On May 31, 2005, at 6:21 PM, Jonathan del Strother wrote:


On 31 May 2005, at 15:21, Scott Thompson wrote:


For Tiger and later, your best bet is probably to replace that code with CGBitmapContextCreate and the image import routines in Image I/O.


Thanks for the pointers.  Took a while, but it's finally working.  Though I was a little disappointed to find that it's actually a little slower than the original QuickTime code...
Are there any resources anywhere that talk about the best way of getting an image from Quartz to OpenGL?  My app is currently spending a vast amount of time in gleExtractPixel_BGRA_8888Rev (in glTexImage2D).

I'm not the best person in the world for OpenGL work.  I do know that there are certain optimizations you can use to ensure that your graphics take the fastest path through the OpenGL pipeline.

From the routine you mention above, it would appear that the computer is spending a lot of time converting your image data to ARGB data.  There is a code sample:

http://developer.apple.com/samplecode/TextureRange/TextureRange.html

Which specifically addresses optimal paths to get your texture data uploaded to OpenGL.  The "Description" of that code sample describes a lot of these.  The most interesting one that may relate to your problem is GL_UNPACK_CLIENT_STORAGE_APPLE extension.  This allows the computer to DMA your texture data directly out of main memory to the graphics card.  It's unclear with the information you've provided whether or not you are already using this technique.

The other guess I might make is that the data in your pixel buffer is not already ARGB data.  If this is the case you might be able to speed things up by figgling the data into that format before trying to use it in the texture.

Apart from the sample code, you can also interact with the folks on the Open GL lists:

http://lists.apple.com/mailman/listinfo/mac-opengl

and the Quartz Dev list:

http://lists.apple.com/mailman/listinfo/quartz-dev

The folks that frequent these lists have always been extremely gracious with my clumsy understanding of OpenGL.  You might also glean some information by searching the archives on those lists.

On the whole, however, it would be nice to know a bit more about what your code is trying to accomplish and how it is going about doing so.  Without knowing what path your code is going through now, it's hard to make specific suggestions about how to improve it. :-)

Scott



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

This email sent to email@hidden

References: 
 >"DisposeGWorld is deprecated" (From: Jonathan del Strother <email@hidden>)
 >Re: "DisposeGWorld is deprecated" (From: Jonathan del Strother <email@hidden>)
 >Re: "DisposeGWorld is deprecated" (From: Scott Thompson <email@hidden>)
 >Re: "DisposeGWorld is deprecated" (From: Jonathan del Strother <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.