MCPcopy Create free account
hub / github.com/LibreVR/Revive / SetQuickItem

Method SetQuickItem

ReviveOverlay/openvroverlaycontroller.cpp:430–454  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

428// Purpose:
429//-----------------------------------------------------------------------------
430void COpenVROverlayController::SetQuickItem( QQuickItem *pItem )
431{
432 m_pFbo = new QOpenGLFramebufferObject( pItem->width(), pItem->height(), QOpenGLFramebufferObject::CombinedDepthStencil );
433 m_pWindow->setRenderTarget(m_pFbo);
434
435 // The root item is ready. Associate it with the window.
436 pItem->setParentItem(m_pWindow->contentItem());
437
438 // Initialize the render control and our OpenGL resources.
439 m_pOpenGLContext->makeCurrent(m_pOffscreenSurface);
440 m_pRenderControl->initialize(m_pOpenGLContext);
441
442 if( vr::VROverlay() )
443 {
444 vr::HmdVector2_t vecWindowSize =
445 {
446 (float)pItem->width(),
447 (float)pItem->height()
448 };
449 vr::VROverlay()->SetOverlayMouseScale( m_ulOverlayHandle, &vecWindowSize );
450 }
451
452 if (!QCoreApplication::arguments().contains("-compositor"))
453 m_pWindow->show();
454}
455
456
457//-----------------------------------------------------------------------------

Callers 1

mainFunction · 0.80

Calls 1

showMethod · 0.80

Tested by

no test coverage detected