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


C++ QSurfaceFormat::setStencilBufferSize方法代码示例

本文整理汇总了C++中QSurfaceFormat::setStencilBufferSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QSurfaceFormat::setStencilBufferSize方法的具体用法?C++ QSurfaceFormat::setStencilBufferSize怎么用?C++ QSurfaceFormat::setStencilBufferSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSurfaceFormat的用法示例。


在下文中一共展示了QSurfaceFormat::setStencilBufferSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initialize

void KisOpenGL::initialize()
{
#ifdef HAVE_OPENGL
    dbgUI << "OpenGL: initializing";

    KisConfig cfg;

    QSurfaceFormat format;
    format.setProfile(QSurfaceFormat::CompatibilityProfile);
    format.setOptions(QSurfaceFormat::DeprecatedFunctions);
    format.setDepthBufferSize(24);
    format.setStencilBufferSize(8);
    format.setVersion(3, 2);
    // if (cfg.disableDoubleBuffering()) {
    if (false) {
        format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
    }
    else {
        format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
    }
    format.setSwapInterval(0); // Disable vertical refresh syncing
    QSurfaceFormat::setDefaultFormat(format);

#endif
}
开发者ID:hshrimali,项目名称:krita,代码行数:25,代码来源:kis_opengl.cpp

示例2: qglx_reduceSurfaceFormat

QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *reduced)
{
    QSurfaceFormat retFormat = format;
    *reduced = true;

    if (retFormat.redBufferSize() > 1) {
        retFormat.setRedBufferSize(1);
    } else if (retFormat.greenBufferSize() > 1) {
        retFormat.setGreenBufferSize(1);
    } else if (retFormat.blueBufferSize() > 1) {
        retFormat.setBlueBufferSize(1);
    } else if (retFormat.samples() > 1) {
        retFormat.setSamples(qMin(retFormat.samples() / 2, 16));
    } else if (retFormat.stereo()) {
        retFormat.setStereo(false);
    }else if (retFormat.stencilBufferSize() > 0) {
        retFormat.setStencilBufferSize(0);
    }else if (retFormat.hasAlpha()) {
        retFormat.setAlphaBufferSize(0);
    }else if (retFormat.depthBufferSize() > 0) {
        retFormat.setDepthBufferSize(0);
    }else if (retFormat.swapBehavior() != QSurfaceFormat::SingleBuffer) {
        retFormat.setSwapBehavior(QSurfaceFormat::SingleBuffer);
    }else{
        *reduced = false;
    }
    return retFormat;
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:28,代码来源:qglxconvenience.cpp

示例3: QOpenGLWidget

OGLViewer::OGLViewer(QWidget *parent)
	: QOpenGLWidget(parent), mTimeCount(0), mFps(30)
	, mSelectMode(OBJECT_SELECT)
	, mViewCamera(new PerspectiveCamera(Point3f(10, 6, 11),
                                     Point3f(0, 0, 0),
                                     Vector3f(0, 1, 0),
                                     width() / float(height())))
	, box_mesh(new TriangleMesh("../../scene/obj/cube_large.obj"))
	, model_mesh(new TriangleMesh("../../scene/obj/monkey.obj"))
{
	// Set surface format for current widget
	QSurfaceFormat format;
	format.setDepthBufferSize(32);
	format.setStencilBufferSize(8);
	format.setSamples(4);
	format.setVersion(4, 5);
	format.setProfile(QSurfaceFormat::CoreProfile);
	this->setFormat(format);

	// Link timer trigger
	/*process_time.start();
	QTimer *timer = new QTimer(this);
	//timer->setSingleShot(false);
	connect(timer, SIGNAL(timeout()), this, SLOT(update()));
	timer->start(0);*/
}
开发者ID:ShenyaoKe,项目名称:QtOpenGL_Template,代码行数:26,代码来源:OGLViewer.cpp

示例4: QOpenGLWidget

OGLViewer::OGLViewer(QWidget *parent)
	: QOpenGLWidget(parent), tcount(0), fps(30)
	, simp_lv(1)
	, m_selectMode(OBJECT_SELECT)
{
	// Set surface format for current widget
	QSurfaceFormat format;
	format.setDepthBufferSize(32);
	format.setStencilBufferSize(8);
	format.setVersion(4, 5);
	format.setProfile(QSurfaceFormat::CoreProfile);
	this->setFormat(format);

	// Read obj file
	//box_mesh = new Mesh("../../scene/obj/cube_large.obj");
	//model_mesh = new Mesh("../../scene/obj/monkey.obj");
#ifdef _DEBUG
	hds_box = new HDS_Mesh("../../scene/obj/frog.obj");
#else
	hds_box = new HDS_Mesh("quad_cube.obj");
#endif
	//hds_box->reIndexing();
	//hds_box->validate();
	simp_mesh = new Simplification(simp_lv, hds_box);

	resetCamera();
}
开发者ID:ShenyaoKe,项目名称:GeometricModeling,代码行数:27,代码来源:OGLViewer.cpp

示例5: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QApplication::setApplicationName("Editor");
    QApplication::setApplicationVersion("1.0");
#if C3_OS == C3_OS_WINDOWS_NT
	//Windows native theme looks so ugly
	app.setStyle("fusion");
#endif

    QCommandLineParser parser;
    parser.setApplicationDescription("The Editor");
    parser.addHelpOption();
    parser.addVersionOption();
    QCommandLineOption dataDirOption("root",
                                     "Root directory location.\nThis will override ENGINE_ROOT.",
                                     "path");
    parser.addOption(dataDirOption);
    parser.process(app);

    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
    QString absPath;
    if(!parser.value(dataDirOption).isEmpty())
    {
        absPath = parser.value(dataDirOption);
    }
    else if(env.contains("ENGINE_ROOT"))
        absPath = env.value("ENGINE_ROOT");
    else
        absPath = ".";
    QFileInfo dirInfo(absPath);
    if(!dirInfo.exists() || !dirInfo.isDir() || !QFileInfo::exists(absPath + "/Data"))
    {
        const char* msg = "Invalid root directory!";
        QMessageBox::critical(nullptr, app.applicationName(), msg);
        throw msg;
    }
    absPath = dirInfo.canonicalFilePath();
    EngineLoader.SetRootDirectory(absPath.toUtf8().constData());

    c3::RC.Loader = &EngineLoader;
    c3::RC.Loader->InitEngine();

    c3::FEditor EditorController;
    c3::RC.Editor = &EditorController;

    QSurfaceFormat format;
    format.setVersion(4, 5);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setDepthBufferSize(24);
    format.setStencilBufferSize(8);
    QSurfaceFormat::setDefaultFormat(format);

    MainWindow mainWindow;
	c3::FLogDisplay* LogDisplay = static_cast<c3::FLogDisplay*>(EditorController.GetLogDisplay());
    QObject::connect(LogDisplay, &c3::FLogDisplay::LogRefreshed,
                     &mainWindow, &MainWindow::OnLogChanged);
	mainWindow.showMaximized();
    app.exec();
}
开发者ID:cyj0912,项目名称:Construct3,代码行数:60,代码来源:Main.cpp

示例6: qSurfaceFormatFromPixelFormat

static QSurfaceFormat
    qSurfaceFormatFromPixelFormat(const PIXELFORMATDESCRIPTOR &pfd,
                                         QWindowsOpenGLAdditionalFormat *additionalIn = 0)
{
    QSurfaceFormat format;
    if (pfd.dwFlags & PFD_DOUBLEBUFFER)
        format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
    format.setDepthBufferSize(pfd.cDepthBits);

    if (pfd.iPixelType == PFD_TYPE_RGBA)
        format.setAlphaBufferSize(pfd.cAlphaBits);
    format.setRedBufferSize(pfd.cRedBits);
    format.setGreenBufferSize(pfd.cGreenBits);
    format.setBlueBufferSize(pfd.cBlueBits);
    format.setStencilBufferSize(pfd.cStencilBits);
    format.setStereo(pfd.dwFlags & PFD_STEREO);
    if (additionalIn) {
        QWindowsOpenGLAdditionalFormat additional;
        if (isDirectRendering(pfd))
            additional.formatFlags |= QWindowsGLDirectRendering;
        if (hasGLOverlay(pfd))
            additional.formatFlags |= QWindowsGLOverlay;
        if (pfd.cAccumRedBits)
            additional.formatFlags |= QWindowsGLAccumBuffer;
        if (testFlag(pfd.dwFlags, PFD_DRAW_TO_BITMAP)) {
            additional.formatFlags |= QWindowsGLRenderToPixmap;
            additional.pixmapDepth = pfd.cColorBits;
        }
        *additionalIn = additional;
    }
    return format;
}
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:32,代码来源:qwindowsglcontext.cpp

示例7: ScreenKeyboard

SsvepBciScreen::SsvepBciScreen(QSharedPointer<SsvepBci> pSsvepBci, QSharedPointer<SsvepBciSetupStimulusWidget> pSsvepBciSetupStimulusWidget, QOpenGLWidget *parent)
: m_pSsvepBci(pSsvepBci)
, m_pSsvepBciSetupStimulusWidget(pSsvepBciSetupStimulusWidget)
, m_pScreenKeyboard(QSharedPointer<ScreenKeyboard>(new ScreenKeyboard(m_pSsvepBci, m_pSsvepBciSetupStimulusWidget, QSharedPointer<SsvepBciScreen>(this))))
, m_dXPosCross(0.5)
, m_dYPosCross(0.5)
, m_dStep(0.01)
, m_bUseScreenKeyboard(false)
, m_qPainter(this)
, m_qCrossColor(Qt::red)
, m_bClearScreen(true)
{
    Q_UNUSED(parent);


    // register Meta Type
    qRegisterMetaType<MyQList>("MyQList");

    //set format of the QOpenGLWidget (enable vsync and setup buffers)
    QSurfaceFormat format;
    format.setDepthBufferSize(24);
    format.setStencilBufferSize(8);
    format.setSwapInterval(1);
    setFormat(format);

    // set update behaviour to preserved-swap-buffer
    setUpdateBehavior(UpdateBehavior::PartialUpdate);

    // connect classResult and frequency list signal of SsvepBci class to setClassResult slot
    connect(m_pSsvepBci.data(), &SsvepBci::classificationResult, this, &SsvepBciScreen::setClassResults);
    connect(m_pSsvepBci.data(), &SsvepBci::getFrequencyLabels, this, &SsvepBciScreen::updateFrequencyList);

    // initialize freqList
    m_lFreqList << 6.66 << 7.5 << 8.57 << 10 << 12;
}
开发者ID:JanaKiesel,项目名称:mne-cpp,代码行数:35,代码来源:ssvepbciscreen.cpp

示例8: getDefaultOpenGLSurfaceFormat

const QSurfaceFormat& getDefaultOpenGLSurfaceFormat() {
    static QSurfaceFormat format;
    static std::once_flag once;
    std::call_once(once, [] {
#if defined(USE_GLES)
        format.setRenderableType(QSurfaceFormat::OpenGLES);
        format.setRedBufferSize(8);
        format.setGreenBufferSize(8);
        format.setBlueBufferSize(8);
        format.setAlphaBufferSize(8);
#else
        format.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
#endif
        if (gl::Context::enableDebugLogger()) {
            format.setOption(QSurfaceFormat::DebugContext);
        }
        // Qt Quick may need a depth and stencil buffer. Always make sure these are available.
        format.setDepthBufferSize(DEFAULT_GL_DEPTH_BUFFER_BITS);
        format.setStencilBufferSize(DEFAULT_GL_STENCIL_BUFFER_BITS);
        int major, minor;
        ::gl::getTargetVersion(major, minor);
        format.setMajorVersion(major);
        format.setMinorVersion(minor);
    });
    return format;
}
开发者ID:Menithal,项目名称:hifi,代码行数:26,代码来源:GLHelpers.cpp

示例9: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    Q_INIT_RESOURCE(ARehab_vTerapeuta);

    QSurfaceFormat format;
    format.setVersion(4, 3);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setOption(QSurfaceFormat::DebugContext);
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setDepthBufferSize(24);
    format.setStencilBufferSize(8);
    format.setSamples(4);
    format.setSwapInterval(0); //Disable VSync
    QSurfaceFormat::setDefaultFormat(format);

    ARehabGUIDesigner::ARehabMainWindow w;

    QFile styleFile(":/styles/main.qss");
    styleFile.open(QFile::ReadOnly);
    app.setStyleSheet(QLatin1String(styleFile.readAll()));
    styleFile.close();

    w.show();
    return (app.exec());
}
开发者ID:JJ,项目名称:ARehab,代码行数:27,代码来源:main.cpp

示例10: init

void ccApplication::init()
{
	//See http://doc.qt.io/qt-5/qopenglwidget.html#opengl-function-calls-headers-and-qopenglfunctions
	/** Calling QSurfaceFormat::setDefaultFormat() before constructing the QApplication instance is mandatory
		on some platforms (for example, OS X) when an OpenGL core profile context is requested. This is to
		ensure that resource sharing between contexts stays functional as all internal contexts are created
		using the correct version and profile.
	**/
	{
		QSurfaceFormat format = QSurfaceFormat::defaultFormat();
		
		format.setSwapBehavior( QSurfaceFormat::DoubleBuffer );
		format.setStencilBufferSize( 0 );
		
#ifdef CC_GL_WINDOW_USE_QWINDOW
		format.setStereo( true );
#endif
		
#ifdef Q_OS_MAC
		format.setVersion( 2, 1 );	// must be 2.1 - see ccGLWindow::functions()
		format.setProfile( QSurfaceFormat::CoreProfile );
#endif
		
#ifdef QT_DEBUG
		format.setOption( QSurfaceFormat::DebugContext, true );
#endif
		
		QSurfaceFormat::setDefaultFormat( format );
	}
	
	// The 'AA_ShareOpenGLContexts' attribute must be defined BEFORE the creation of the Q(Gui)Application
	// DGM: this is mandatory to enable exclusive full screen for ccGLWidget (at least on Windows)
	QCoreApplication::setAttribute( Qt::AA_ShareOpenGLContexts );
}
开发者ID:MrCairo90,项目名称:CloudCompare,代码行数:34,代码来源:ccApplication.cpp

示例11: createAndSetPlatformContext

void QMinimalEglScreen::createAndSetPlatformContext()
{
    QSurfaceFormat platformFormat;

    QByteArray depthString = qgetenv("QT_QPA_EGLFS_DEPTH");
    if (depthString.toInt() == 16) {
        platformFormat.setDepthBufferSize(16);
        platformFormat.setRedBufferSize(5);
        platformFormat.setGreenBufferSize(6);
        platformFormat.setBlueBufferSize(5);
        m_depth = 16;
        m_format = QImage::Format_RGB16;
    } else {
        platformFormat.setDepthBufferSize(24);
        platformFormat.setStencilBufferSize(8);
        platformFormat.setRedBufferSize(8);
        platformFormat.setGreenBufferSize(8);
        platformFormat.setBlueBufferSize(8);
        m_depth = 32;
        m_format = QImage::Format_RGB32;
    }

    if (!qEnvironmentVariableIsEmpty("QT_QPA_EGLFS_MULTISAMPLE"))
        platformFormat.setSamples(4);

    EGLConfig config = q_configFromGLFormat(m_dpy, platformFormat);

    EGLNativeWindowType eglWindow = 0;
#ifdef Q_OPENKODE
    if (kdInitializeNV() == KD_ENOTINITIALIZED) {
        qFatal("Did not manage to initialize openkode");
    }
    KDWindow *window = kdCreateWindow(m_dpy,config,0);

    kdRealizeWindow(window,&eglWindow);
#endif

#ifdef QEGL_EXTRA_DEBUG
    q_printEglConfig(m_dpy, config);
#endif

    m_surface = eglCreateWindowSurface(m_dpy, config, eglWindow, NULL);
    if (m_surface == EGL_NO_SURFACE) {
        qWarning("Could not create the egl surface: error = 0x%x\n", eglGetError());
        eglTerminate(m_dpy);
        qFatal("EGL error");
    }
    //    qWarning("Created surface %dx%d\n", w, h);

    QEGLPlatformContext *platformContext = new QMinimalEglContext(platformFormat, 0, m_dpy);
    m_platformContext = platformContext;

    EGLint w,h;                    // screen size detection
    eglQuerySurface(m_dpy, m_surface, EGL_WIDTH, &w);
    eglQuerySurface(m_dpy, m_surface, EGL_HEIGHT, &h);

    m_geometry = QRect(0,0,w,h);

}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:59,代码来源:qminimaleglscreen.cpp

示例12: QOpenGLWidget

OGLViewer::OGLViewer(QWidget *parent)
	: QOpenGLWidget(parent), tcount(0)
	, fps(30), timestep(1.0 / fps), isSim(false)
{
	// Set surface format for current widget
	QSurfaceFormat format;
	format.setDepthBufferSize(32);
	format.setStencilBufferSize(8);
	format.setVersion(4, 5);
	format.setProfile(QSurfaceFormat::CoreProfile);
	this->setFormat(format);

	// Link timer trigger
	process_time.start();
	QTimer *timer = new QTimer(this);
	/*timer->setSingleShot(false);*/
	connect(timer, SIGNAL(timeout()), this, SLOT(update()));
	timer->start(0);

	// Read obj file
#ifdef _DEBUG
	box_mesh = new Mesh("../../scene/obj/cube_huge.obj");
	poly_mesh = new Mesh("../../scene/obj/bunny_simple.obj");
	poly_bound = new Mesh("../../scene/obj/bunny_bound.obj");
#else
	box_mesh = new Mesh("cube_large.obj");
	poly_mesh = new Mesh("bunny_simple.obj");
	poly_bound = new Mesh("bunny_bound.obj");
#endif // _DEBUG
	poly_bound->refine(triangleList);
	mytree = new KdTreeAccel(triangleList);

	texW = sparkTex.getWidth();
	texH = sparkTex.getHeight();
	sparkTex.getPixelsRGBA(tex_pixels);

	// Initialize particle generators
	//Point3D newpos(0.0, 0.0, 0.0), vel(0.3, 1.0, 1.0), vel_var(0.3, 0.3, 0.3);
	ParticleGenerator* pg = new ParticleGenerator(
		3500, 1000, 20, timestep, 3, 0.6,
		2.0, 1.2,
		Point3D(0.0, 5.0, 0.0),
		Vector3D(0, -10, 0), Vector3D(1, 0, 0),
		ParticleGenerator::CONCENTRIC_DISK, 0.5);
	Vector3D* gravity = new Vector3D(0.0, -9.8, 0.0);
	Vector3D* wind = new Vector3D(0, 0.0, 0.0);
	pg->addForce(gravity);
	pg->addForce(wind);
	pgs.push_back(pg);
	pg->exportVBO(ptc_size, ptc_verts, ptc_vels, ptc_life, ptc_alive, true);
	pg->addCollision(mytree);
	

	resetCamera();

	// Initialize transform matrix
	matrix.setIdentity();// setRotation(20, 0, 0);
	matrix.exportVBO(model_mat);
}
开发者ID:ShenyaoKe,项目名称:PhysicallyBasedModeling,代码行数:59,代码来源:OGLViewer.cpp

示例13: main

int main(int argc, char* argv[]) {
    // read the header
    const auto header = sepia::read_header(sepia::filename_to_ifstream(filename));

    // create the Qt Application
    QGuiApplication app(argc, argv);

    // register Chameleon types
    qmlRegisterType<chameleon::background_cleaner>("Chameleon", 1, 0, "BackgroundCleaner");
    qmlRegisterType<chameleon::dvs_display>("Chameleon", 1, 0, "DvsDisplay");
    qmlRegisterType<chameleon::flow_display>("Chameleon", 1, 0, "FlowDisplay");

    // pass the header properties to qml
    QQmlApplicationEngine application_engine;
    application_engine.rootContext()->setContextProperty("header_width", header.width);
    application_engine.rootContext()->setContextProperty("header_height", header.height);

    // load the view and setup the window properties for OpenGL renderring
    application_engine.loadData(
#include "optical_flow.qml"
    );
    auto window = qobject_cast<QQuickWindow*>(application_engine.rootObjects().first());
    {
        QSurfaceFormat format;
        format.setDepthBufferSize(24);
        format.setStencilBufferSize(8);
        format.setVersion(3, 3);
        format.setProfile(QSurfaceFormat::CoreProfile);
        window->setFormat(format);
    }

    // retrieve pointers to the displays generated by qml
    auto dvs_display = window->findChild<chameleon::dvs_display*>("dvs_display");
    auto flow_display = window->findChild<chameleon::flow_display*>("flow_display");

    // create the event handling pipeline
    auto observable = sepia::make_observable<sepia::type::dvs>(
        sepia::filename_to_ifstream(filename),
        tarsier::make_replicate<sepia::dvs_event>(
            [&](sepia::dvs_event dvs_event) { dvs_display->push(dvs_event); },
            sepia::make_split<sepia::type::dvs>(
                tarsier::make_compute_flow<sepia::simple_event, flow_event>(
                    header.width,
                    header.height,
                    3,     // spatial window's radius
                    10000, // temporal window
                    8,     // minimum number of events in the spatio-temporal window required to trigger a flow event
                    [&](sepia::simple_event simple_event, float vx, float vy) -> flow_event {
                        return {simple_event.t, simple_event.x, simple_event.y, vx, vy};
                    },
                    [&](flow_event flow_event) { flow_display->push(flow_event); }),
                [](sepia::simple_event) {})),
        [](std::exception_ptr) {},
        []() { return true; });

    // run the Qt Application
    return app.exec();
}
开发者ID:neuromorphic-paris,项目名称:tutorials,代码行数:58,代码来源:optical_flow.cpp

示例14: updateView

void MainWindow::updateView()
{
    QSurfaceFormat format;
    format.setDepthBufferSize(16);
    format.setStencilBufferSize(8);
    if (m_transparent)
        format.setAlphaBufferSize(8);
    if (m_checkboxMultiSample->isChecked())
        format.setSamples(4);

    State state = m_radioView->isChecked() ? UseWindow : UseWidget;

    if (m_format == format && m_state == state)
        return;

    m_format = format;
    m_state = state;

    QString text = m_currentRootObject
            ? m_currentRootObject->property("currentText").toString()
            : QStringLiteral("Hello Qt");

    QUrl source("qrc:qquickviewcomparison/test.qml");

    if (m_state == UseWindow) {
        QQuickView *quickView = new QQuickView;
        // m_transparent is not supported here since many systems have problems with semi-transparent child windows
        quickView->setFormat(m_format);
        quickView->setResizeMode(QQuickView::SizeRootObjectToView);
        connect(quickView, &QQuickView::statusChanged, this, &MainWindow::onStatusChangedView);
        connect(quickView, &QQuickView::sceneGraphError, this, &MainWindow::onSceneGraphError);
        quickView->setSource(source);
        m_currentRootObject = quickView->rootObject();
        switchTo(QWidget::createWindowContainer(quickView));
    } else if (m_state == UseWidget) {
        QQuickWidget *quickWidget = new QQuickWidget;
        if (m_transparent) {
            quickWidget->setClearColor(Qt::transparent);
            quickWidget->setAttribute(Qt::WA_TranslucentBackground);
        }
        quickWidget->setFormat(m_format);
        quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
        connect(quickWidget, &QQuickWidget::statusChanged, this, &MainWindow::onStatusChangedWidget);
        connect(quickWidget, &QQuickWidget::sceneGraphError, this, &MainWindow::onSceneGraphError);
        quickWidget->setSource(source);
        m_currentRootObject = quickWidget->rootObject();
        switchTo(quickWidget);
    }

    if (m_currentRootObject) {
        m_currentRootObject->setProperty("currentText", text);
        m_currentRootObject->setProperty("multisample", m_checkboxMultiSample->isChecked());
        m_currentRootObject->setProperty("translucency", m_transparent);
    }

    m_overlayLabel->raise();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:57,代码来源:mainwindow.cpp

示例15: controlContext

void HsQMLContextControl::controlContext()
{
    // Do nothing if no window
    if (!mWindow) {
        return;
    }

    // Do nothing if changes are being deferred
    if (mDefer || !mWhen) {
        mPending = true;
        return;
    }
    mPending = false;

    QSurfaceFormat fmt = mOriginal;
    if (mMajorVersion >= 0) {
        fmt.setMajorVersion(mMajorVersion);
    }
    if (mMinorVersion >= 0) {
        fmt.setMinorVersion(mMinorVersion);
    }
    if (mContextType >= 0) {
        fmt.setRenderableType(static_cast<QSurfaceFormat::RenderableType>(
            mContextType));
    }
    if (mContextProfile >= 0) {
        fmt.setProfile(static_cast<QSurfaceFormat::OpenGLContextProfile>(
            mContextProfile));
    }
    if (mDeprecatedFunctionsSet) {
#if QT_VERSION >= 0x050300
        fmt.setOption(QSurfaceFormat::DeprecatedFunctions,
            mDeprecatedFunctions);
#else
        if (mDeprecatedFunctions) {
            fmt.setOption(QSurfaceFormat::DeprecatedFunctions);
        }
#endif
    }
    fmt.setDepthBufferSize(qMax(fmt.depthBufferSize(), mDepthBufferSize));
    fmt.setStencilBufferSize(qMax(fmt.stencilBufferSize(), mStencilBufferSize));
    if (fmt == mWindow->requestedFormat()) {
        return;
    }
    mWindow->setFormat(fmt);

    // Recreate OpenGL context
    mWindow->setPersistentOpenGLContext(false);
    mWindow->setPersistentSceneGraph(false);
    bool visible = mWindow->isVisible();
    mWindow->destroy();
    mWindow->releaseResources();
    mWindow->setVisible(visible);
    mWindow->setPersistentOpenGLContext(true);
    mWindow->setPersistentSceneGraph(true);
}
开发者ID:johntyree,项目名称:HsQML,代码行数:56,代码来源:Canvas.cpp


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