[MonoTouch] CVOpenGLESTextureCacheCreateTextureFromImage in Monotouch?

sinsro sinsro at hotmail.com
Wed Mar 7 17:44:20 UTC 2012


Thank you. Do you mind to give a similar example for
CVOpenGLESTextureCacheCreate as well? Not familiar with how the required
parameters converts to Monotouch...

Also, it's still not clear how to define some of the other needed
constants/parameters as well. Can you advice on how this is done in
Monotouch when the xCode version looks like this:

CVOpenGLESTextureCacheRef videoTextureCache;

CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL,
self.context, NULL, &videoTextureCache);

CVReturn err =
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
                                                                       
videoTextureCache,
                                                                       
imageBuffer,
                                                                       
NULL,
                                                                       
GL_TEXTURE_2D,
                                                                       
GL_RGBA,
                                                                       
frameWidth,
                                                                       
frameHeight,
                                                                       
GL_BGRA,
                                                                       
GL_UNSIGNED_BYTE,
                                                                        0,
                                                                       
&texture);

Some of the parameters I can guess. I suppose NULL is System.IntPtr.Zero,
and GL_TEXTURE_2D is All.Texture2D, GL_BGRA is All.Bgra, GL_RGBA is All.Rgba
and GL_UNSIGNED_BYTE is All.UnsignedByte. 

The imagebuffer parameter I guess is
((CVPixelBuffer)imageBuffer).BaseAddress? or..?

And, how to define CVOpenGLESTextureCacheRef? And what is
kCFAllocatorDefault in Monotouch, I am guessing System.IntPtr.Zero? 

Any clarification on how to make the above three lines work in Monotouch
would be much appreciated, as I find the type conversion to be quite
confusing, and as you can see I am just guessing pretty much wildly here... 
:S


--
View this message in context: http://monotouch.2284126.n4.nabble.com/CVOpenGLESTextureCacheCreateTextureFromImage-in-Monotouch-tp4452542p4453970.html
Sent from the MonoTouch mailing list archive at Nabble.com.


More information about the MonoTouch mailing list