Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

CVImageBufferRef to OpenGL

Has anyone managed to turn a CVImageBufferRef into an OpenGLES texture? I´ve tried using:

glTexImage2D(GL TEXTURE2D, 0, GL_RGBA, width, height, 0, GL_BGRA, GL UNSIGNEDINT, CVPixelBufferGetBaseAddress(image));

but the texture comes out completely black. Any help?

IPhone 3GS, iOS 4, none

Posted on Sep 29, 2010 9:38 AM

Reply
1 reply

Oct 10, 2010 5:33 AM in response to Arkano

I think you should just be able to use CVImageBufferRef directly as a texture:

CVImageBufferRef image;
...
glBindTexture( CVOpenGLTextureGetTarget( image ), CVOpenGLTextureGetName( image ) );

This certainly works for me in a modified version of Apple's QTCoreImage101 example, but I'd be interested to know if it is considered completely safe.

CVImageBufferRef to OpenGL

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.