title: glResolveMultisampleFramebufferAPPLE() generate GL_INVALID_OPERATION on iOS (OpenGL ES 2.0)
body: <p>I want to use function <code>glReadPixels()</code> to do screenshot of my scene. And it works great if I don't use multisampling. But if I do I get <code>GL_INVALID_OPERATION</code> in <code>glResolveMultisampleFramebufferAPPLE()</code>. Is there a way to resolve this problem?</p>
  
  <p>My save function:</p>
  
  <pre><code>    var wid = GLint()
      var hei = GLint()
      glGetRenderbufferParameteriv(GLenum(GL_RENDERBUFFER), GLenum(GL_RENDERBUFFER_WIDTH), &amp;wid)
      glGetRenderbufferParameteriv(GLenum(GL_RENDERBUFFER), GLenum(GL_RENDERBUFFER_HEIGHT), &amp;hei)
      let byteLength = Int(hei * wid) * 4
      let bytes = UnsafeMutablePointer&lt;GLubyte&gt;.alloc(byteLength)
  
      // init non-multisampled frame buffer
      var framebuffer: GLuint = 0
      var colorRenderbuffer: GLuint = 0
  
      glGenFramebuffersOES(1, &amp;framebuffer)
      glBindFramebufferOES(GLenum(GL_FRAMEBUFFER_OES), framebuffer)
  
      glGenRenderbuffersOES(1, &amp;colorRenderbuffer)
      glBindRenderbufferOES(GLenum(GL_RENDERBUFFER_OES), colorRenderbuffer)
      glRenderbufferStorageOES(GLenum(GL_RENDERBUFFER_OES), GLenum(GL_RGBA8_OES), wid, hei)
      glFramebufferRenderbufferOES(GLenum(GL_FRAMEBUFFER_OES), GLenum(GL_COLOR_ATTACHMENT0_OES), GLenum(GL_RENDERBUFFER_OES), colorRenderbuffer)
  
      glBindFramebufferOES(GLenum(GL_DRAW_FRAMEBUFFER_APPLE), framebuffer)
  
      var default: GLint = 0
      glGetIntegerv(GLenum(GL_FRAMEBUFFER_BINDING_OES), &amp;default)
      glBindFramebufferOES(GLenum(GL_READ_FRAMEBUFFER_APPLE), GLuint(default));
  
      myglGetError() // OK
      glResolveMultisampleFramebufferAPPLE()
      myglGetError() // GL_INVALID_OPERATION
  
      glBindFramebuffer(GLenum(GL_FRAMEBUFFER), framebuffer)
  
      glReadPixels(0, 0, GLsizei(wid), GLsizei(hei), GLenum(GL_RGBA), GLenum(GL_UNSIGNED_BYTE), bytes)
  
      glBindFramebuffer(GLenum(GL_FRAMEBUFFER), GLuint(default));
      glDeleteFramebuffers(1, &amp;framebuffer)
  </code></pre>
  
  <p>I use default frame buffer initialized by <code>GLKit</code> with <code>glkView.drawableMultisample = GLKViewDrawableMultisample.Multisample4X</code></p>