MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / SetWidget

Method SetWidget

samples/helloworldoverlay/openvroverlaycontroller.cpp:316–338  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

314// Purpose:
315//-----------------------------------------------------------------------------
316void COpenVROverlayController::SetWidget( QWidget *pWidget )
317{
318 if( m_pScene )
319 {
320 // all of the mouse handling stuff requires that the widget be at 0,0
321 pWidget->move( 0, 0 );
322 m_pScene->addWidget( pWidget );
323 }
324 m_pWidget = pWidget;
325
326 m_pFbo = new QOpenGLFramebufferObject( pWidget->width(), pWidget->height(), GL_TEXTURE_2D );
327
328 if( vr::VROverlay() )
329 {
330 vr::HmdVector2_t vecWindowSize =
331 {
332 (float)pWidget->width(),
333 (float)pWidget->height()
334 };
335 vr::VROverlay()->SetOverlayMouseScale( m_ulOverlayHandle, &vecWindowSize );
336 }
337
338}
339
340
341//-----------------------------------------------------------------------------

Callers 1

mainFunction · 0.80

Calls 1

SetOverlayMouseScaleMethod · 0.45

Tested by

no test coverage detected