本文整理汇总了C++中QOpenGLContext::handle方法的典型用法代码示例。如果您正苦于以下问题:C++ QOpenGLContext::handle方法的具体用法?C++ QOpenGLContext::handle怎么用?C++ QOpenGLContext::handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QOpenGLContext
的用法示例。
在下文中一共展示了QOpenGLContext::handle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
QPlatformOpenGLContext *EglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
QPlatformOpenGLContext *pctx = egl_device_integration()->createPlatformOpenGLContext(context);
if (pctx)
return pctx;
// If there is a "root" window into which raster and QOpenGLWidget content is
// composited, all other contexts must share with its context.
QOpenGLContext *compositingContext = OpenGLCompositor::instance()->context();
EGLDisplay dpy = context->screen() ? static_cast<EglFSScreen *>(context->screen()->handle())->display() : display();
QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
QVariant nativeHandle = context->nativeHandle();
EglFSContext *ctx;
QSurfaceFormat adjustedFormat = egl_device_integration()->surfaceFormatFor(context->format());
if (nativeHandle.isNull()) {
EGLConfig config = EglFSIntegration::chooseConfig(dpy, adjustedFormat);
ctx = new EglFSContext(adjustedFormat, share, dpy, &config, QVariant());
} else {
ctx = new EglFSContext(adjustedFormat, share, dpy, 0, nativeHandle);
}
nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), dpy));
context->setNativeHandle(nativeHandle);
return ctx;
}
示例2: createContext
QPlatformOpenGLContext *QEGLPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(context->screen()->handle());
// If there is a "root" window into which raster and QOpenGLWidget content is
// composited, all other contexts must share with its context.
QOpenGLContext *compositingContext = screen ? screen->compositingContext() : 0;
return createContext(context->format(),
compositingContext ? compositingContext->handle() : context->shareHandle(),
display());
}
示例3: createContext
QPlatformOpenGLContext *QEGLPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
// If there is a "root" window into which raster and QOpenGLWidget content is
// composited, all other contexts must share with its context.
QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
QVariant nativeHandle = context->nativeHandle();
QPlatformOpenGLContext *platformContext = createContext(context->format(),
share,
display(),
&nativeHandle);
context->setNativeHandle(nativeHandle);
return platformContext;
}