static void *eglContextForContext(QOpenGLContext *context)
{
    Q_ASSERT(context);

    QEGLPlatformContext *handle = static_cast<QEGLPlatformContext *>(context->handle());
    if (!handle)
        return 0;

    return handle->eglContext();
}
void * QXcbNativeInterface::eglConfigForContext(QOpenGLContext *context)
{
    Q_ASSERT(context);
#if defined(XCB_USE_EGL)
    QEGLPlatformContext *eglPlatformContext = static_cast<QEGLPlatformContext *>(context->handle());
    return eglPlatformContext->eglConfig();
#else
    Q_UNUSED(context);
    return 0;
#endif
}
Example #3
0
void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
    QByteArray lowerCaseResource = resource.toLower();

    QEGLPlatformContext *handle = static_cast<QEGLPlatformContext *>(context->handle());

    if (!handle)
        return 0;

    if (lowerCaseResource == "eglcontext")
        return handle->eglContext();

    return 0;
}
Example #4
0
void * QXcbNativeInterface::eglContextForWidget(QWidget *widget)
{
    Q_ASSERT(widget);
    if (!widget->platformWindow()) {
        qDebug() << "QPlatformWindow does not exist for widget" << widget
                 << "cannot return EGLContext";
        return 0;
    }
    QPlatformGLContext *platformContext = widget->platformWindow()->glContext();
    if (!platformContext) {
        qDebug() << "QPlatformWindow" << widget->platformWindow() << "does not have a glContext"
                 << "cannot return EGLContext";
        return 0;
    }
#if defined(XCB_USE_EGL)
    QEGLPlatformContext *eglPlatformContext = static_cast<QEGLPlatformContext *>(platformContext);
    return eglPlatformContext->eglContext();
#elif defined (XCB_USE_DRI2)
    QDri2Context *dri2Context = static_cast<QDri2Context *>(platformContext);
    return dri2Context->eglContext();
#else
    return 0;
#endif
}