iphoneopengl-esglblendfunc

iPhone glBlendFunc error


I'm trying to use the glBlendFunc, but it's failing on the first call, with the error "unacceptable value specified for an enumerated argument". I've looked at the header, it appears that GL_DST_COLOR is 0x0306 (774) and that is causing the error, since (GL_ZERO, GL_ZERO) works. Any idea why this would fail like this on the iPhone? It appears in the gl.h header for ES1 and ES2.

  glEnable(GL_BLEND);
  glBlendFunc(GL_ZERO, **GL_DST_COLOR**);

  glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);

  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glDisable(GL_BLEND);

Thanks, Andrew


Solution

  • Only the first paramter, sfactor, can be GL_DST_COLOR. GL_DST_COLOR is not a legal value for the second parameter, dfactor.

    See the parameters section of the documentation.