当前位置: 首页>>代码示例>>C++>>正文


C++ QOpenGLContext::handle方法代码示例

本文整理汇总了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;
}
开发者ID:comicfans,项目名称:greenisland,代码行数:26,代码来源:eglfsintegration.cpp

示例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());
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:10,代码来源:qeglplatformintegration.cpp

示例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;
}
开发者ID:James-intern,项目名称:Qt,代码行数:14,代码来源:qeglplatformintegration.cpp


注:本文中的QOpenGLContext::handle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。