----------------------------------------------------------------------------- Purpose: -----------------------------------------------------------------------------
| 428 | // Purpose: |
| 429 | //----------------------------------------------------------------------------- |
| 430 | void 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 | //----------------------------------------------------------------------------- |