title: Create a CVPixelBufferRef with OpenGLCompatibility
body: <p>I am trying to create a CVPixelBuffer to allocate a bitmap in it and bind it to an OpenGL texture under IOS 5, but I having some problems on it. I can generate the pixel buffer but the IOSurface is always null, so I can not use it with CVOpenGLESTextureCacheCreateTextureFromImage. Since I am not using a Camera or a Video, but an self generated bitmap I can not use CVSampleBufferRef to get the pixel buffer from it.</p>
  
  <p>I let you my code in case some of you knows how to solve this issue.</p>
  
  <pre><code>CVPixelBufferRef renderTarget = nil;
  CFDictionaryRef empty; // empty value for attr value.
  CFMutableDictionaryRef attrs;
  empty = CFDictionaryCreate(kCFAllocatorDefault, // our empty IOSurface properties dictionary
                             NULL,
                             NULL,
                             0,
                             &amp;kCFTypeDictionaryKeyCallBacks,
                             &amp;kCFTypeDictionaryValueCallBacks);
  attrs = CFDictionaryCreateMutable(kCFAllocatorDefault,
                                    2,
                                    &amp;kCFTypeDictionaryKeyCallBacks,
                                    &amp;kCFTypeDictionaryValueCallBacks);
  
  CFDictionarySetValue(attrs,
                       kCVPixelBufferIOSurfacePropertiesKey,
                       empty);
  CFDictionarySetValue(attrs, kCVPixelBufferOpenGLCompatibilityKey, [NSNumber numberWithBool:YES]);
  
  CVReturn err = CVPixelBufferCreateWithBytes(kCFAllocatorDefault, tmpSize.width, tmpSize.height, kCVPixelFormatType_32ARGB, imageData, tmpSize.width*4, 0, 0, attrs, &amp;renderTarget);
  </code></pre>
  
  <p>If I dump the new PixelBufferRef I get:</p>
  
  <pre><code>1 : &lt;CFString 0x3e43024c [0x3f8f8650]&gt;{contents = "OpenGLCompatibility"} = &lt;CFBoolean 0x3f8f8a10 [0x3f8f8650]&gt;{value = true}
  2 : &lt;CFString 0x3e43026c [0x3f8f8650]&gt;{contents = "IOSurfaceProperties"} = &lt;CFBasicHash 0xa655750 [0x3f8f8650]&gt;{type = immutable dict, count = 0,
  entries =&gt;
  }
  
  }
  </code></pre>
  
  <p>And I get an -6683 error (kCVReturnPixelBufferNotOpenGLCompatible) if I try to use it with a TextureCache, this way:</p>
  
  <pre><code>CVOpenGLESTextureCacheCreateTextureFromImage (
                                                kCFAllocatorDefault,
                                                self.eagViewController.textureCache,
                                                renderTarget,
                                                nil, // texture attributes
                                                GL_TEXTURE_2D,
                                                GL_RGBA, // opengl format
                                                tmpSize.width,
                                                tmpSize.height,
                                                GL_BGRA, // native iOS format 
                                                GL_UNSIGNED_BYTE,
                                                0,
                                                &amp;renderTextureTemp);
  </code></pre>