VVGL/src/GLQtCtxWrapper.cpp
//	if 'inTargetSurface' is null, a QOffscreenSurface will be created as a child of the QOpenGLContext.  if it's non-null (a widget or a window or etc), we just get a weak ref to it.
//	if 'inCreateCtx' is YES, a new GL context will be created and it will share 'inCtx'.
//	if 'inCreateCtx' is NO, no GL context will be created and instead a weak ref to 'inCtx' will be established.
if 'inTargetSurface' is null, a QOffscreenSurface will be created as a child of the QOpenGLContext.  if it's non-null (a widget or a window or etc), we just get a weak ref to it.
if 'inCreateCtx' is YES, a new GL context will be created and it will share 'inCtx'.
if 'inCreateCtx' is NO, no GL context will be created and instead a weak ref to 'inCtx' will be established.
if ' inTargetSurface ' is null a QOffscreenSurface will be created as a child of the QOpenGLContext . if it ' s non - null ( a widget or a window or etc ) we just get a weak ref to it . if ' inCreateCtx ' is YES a new GL context will be created and it will share ' inCtx ' . if ' inCreateCtx ' is NO no GL context will be created and instead a weak ref to ' inCtx ' will be established .
GLQtCtxHidden::GLQtCtxHidden(QSurface * inSurface, QOpenGLContext * inCtx, bool inCreateCtx, QSurfaceFormat inSfcFmt)	{
	if (inSurface == nullptr)	{
		strongSurface = new QOffscreenSurface;
		strongSurface->create();
	}
	else	{
		weakSurface = inSurface;
	}
	if (inCreateCtx)	{
		strongCtx = QSharedPointer<QOpenGLContext>(new QOpenGLContext);
		if (inCtx != nullptr)
			strongCtx->setShareContext(inCtx);
		strongCtx->setFormat(inSfcFmt);
		strongCtx->create();
	}
	else	{
		weakCtx = inCtx;
	}
}
GLQtCtxHidden :: GLQtCtxHidden ( QSurface * inSurface , QOpenGLContext * inCtx , bool inCreateCtx , QSurfaceFormat inSfcFmt ) { if ( inSurface == nullptr ) { strongSurface = new QOffscreenSurface ; strongSurface -> create ( ) ; } else { weakSurface = inSurface ; } if ( inCreateCtx ) { strongCtx = QSharedPointer < QOpenGLContext > ( new QOpenGLContext ) ; if ( inCtx != nullptr ) strongCtx -> setShareContext ( inCtx ) ; strongCtx -> setFormat ( inSfcFmt ) ; strongCtx -> create ( ) ; } else { weakCtx = inCtx ; } }
if 'inTargetSurface' is null, a QOffscreenSurface will be created as a child of the QOpenGLContext.
if ' inTargetSurface ' is null a QOffscreenSurface will be created as a child of the QOpenGLContext .
//cout << __PRETTY_FUNCTION__ << ", " << this << endl; //qDebug() << "\tcurrent context is " << QOpenGLContext::currentContext(); //qDebug() << "\tstrongCtx is " << strongCtx.data();