From MozillaWiki
Jump to: navigation, search

It's not true than an AGL surface is the only way to use OpenGL in a plugin. That was true back in the days of Mac OS 9! The CGL interface, along with Core Image and Core Graphics, does work on modern systems; and this method is compatible back to Firefox 2 and Safari 3 (if not earlier) on Mac OS X 10.4.

However, using OpenGL is inconvenient. For every frame, you have to

  • do OpenGL drawing in a pBuffer (i.e., offscreen)
  • create a texture from the pBuffer with CGLTexImagePBuffer
  • use Core Image to create a CIImage from the texture
  • use Core Image to create a CGImage from the CIImage
  • transfer the CGImage into the plugin's CGContext

I can imagine that the new Core Animation implementation is somewhat less messy!

Justinbb 02:24, 10 May 2010 (UTC)