MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / MousePosUpdate

Method MousePosUpdate

Rtxpt/Sample.cpp:709–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709bool Sample::MousePosUpdate(double xpos, double ypos)
710{
711 if (!(m_sampleGame && m_sampleGame->CameraActive()))
712 m_camera.MousePosUpdate(xpos, ypos);
713 if (m_sampleGame) m_sampleGame->MousePosUpdate(xpos /** upscalingScale.x*/, ypos /** upscalingScale.y*/);
714
715 float2 upscalingScale = float2(1,1);
716 if (m_renderTargets != nullptr)
717 upscalingScale = float2(m_renderSize)/float2(m_displaySize);
718
719 m_pickPosition = uint2( static_cast<uint>( xpos * upscalingScale.x ), static_cast<uint>( ypos * upscalingScale.y ) );
720 m_ui.MousePos = uint2( static_cast<uint>( xpos * upscalingScale.x ), static_cast<uint>( ypos * upscalingScale.y ) );
721
722 if (m_zoomTool) m_zoomTool->MousePosUpdate( xpos, ypos );
723
724 return true;
725}
726
727bool Sample::MouseButtonUpdate(int button, int action, int mods)
728{

Callers

nothing calls this directly

Calls 1

CameraActiveMethod · 0.80

Tested by

no test coverage detected