COpenGLView and Carbon


I recently had to port over some of my drawing code to OpenGL, because of the fact that for fairly complex polygons, the CGContextDrawPath() based CGDrawContext::drawPolygon() implementation is so incredibly slow on Mac.

Next I realized the following lines in HIViewFrame:

SharedPointer createPlatformOpenGLView () override { return nullptr; } // not supported

So it seems like OpenGL is entierly unsupported on Mac Carbon. I assume I can’t expect any OpenGL support for Carbon in VSTGUI unless I implement an AGL based CarbonOpenGLView myself. AGL is now deprecated and Carbon seems on the verge of deprecation in VSTGUI too, so this seems like a rather pointless excercise.

As a workaround, I considered offering covariant COpenGLView and CView / Core Graphics based implementations of my view and then switch between the two at runtime depending on the platform. I don’t think this is a particularly elegant way of handling this, so what do you guys suggest?