Source code A uses a CGLContextObj.
Source code B uses a QGLContext.
Is there any way that these pieces of code could share a GL context?
- Can a
QGLContextbe set up from aCGLContextObj? - Can a
CGLContextObjbe set up from aQGLContext? - Can both a
QGLContextand aCGLContextObjbe set up from some other type?
(I understand that CGLContextObj is specific to Apple to while QGLContext is platform-independent. Let’s assume the code is only going to run on a Mac.)
The current GL context is stored in a common thread-local variable, regardless of which application framework you’re using on a given platform. So after you set up a
QGLContext, you could callCGLGetCurrentContext()to get the correspondingCGLContextObj.