本文整理汇总了C++中CModelViewerCamera::IsMouseRButtonDown方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelViewerCamera::IsMouseRButtonDown方法的具体用法?C++ CModelViewerCamera::IsMouseRButtonDown怎么用?C++ CModelViewerCamera::IsMouseRButtonDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelViewerCamera
的用法示例。
在下文中一共展示了CModelViewerCamera::IsMouseRButtonDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//--------------------------------------------------------------------------------------
// Render the scene using the D3D10 device
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D10FrameRender(ID3D10Device* pd3dDevice, double fTime,
float fElapsedTime,
void* pUserContext)
{
HRESULT hr;
g_device->ClearRenderTargetView(g_vsObj->m_TextureTV, D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
g_device->ClearRenderTargetView(g_vsObj->m_diffuseTextureTV[0], D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
g_device->ClearRenderTargetView(g_vsObj->m_diffuseTextureTV[1], D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
g_device->ClearRenderTargetView(g_vsObj->m_otherTextureTV, D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
g_device->ClearRenderTargetView(g_vsObj->m_distDirTextureTV, D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
// If the settings dialog is being shown, then render it instead of rendering the app's scene
if (g_D3DSettingsDlg.IsActive())
{
g_D3DSettingsDlg.OnRender(fElapsedTime);
return;
}
if (g_Camera.m_nMouseWheelDelta && g_Camera.m_nZoomButtonMask == MOUSE_WHEEL)
{
g_vsObj->m_pan /= g_vsObj->m_scale;
g_vsObj->m_scale += g_vsObj->m_scale * g_Camera.m_nMouseWheelDelta * 0.2;
g_vsObj->m_pan *= g_vsObj->m_scale;
g_Camera.m_nMouseWheelDelta = 0;
g_vsObj->m_scale = max(0.01, g_vsObj->m_scale);
}
if ((!g_Camera.IsMouseRButtonDown()) && (g_mouseLButtonDown == true))
{
g_mouseLButtonDown = false;
}
else if (g_Camera.IsMouseRButtonDown())
{
g_mouseLButtonDown = true;
}
else
{
g_mouseLButtonDown = false;
}
if (g_Camera.IsBeingDragged())
{
float ff = 1.0f;
if (g_Camera.IsMouseRButtonDown())
{
ff = 0.127f;
}
float xFac = ff * 4.0f / g_vsObj->m_sizeX;
float yFac = ff * 4.0f / g_vsObj->m_sizeY;
g_vsObj->m_pan += D3DXVECTOR2(xFac * g_Camera.m_vMouseDelta.x,
-yFac * g_Camera.m_vMouseDelta.y);
g_Camera.m_vMouseDelta.x = 0;
g_Camera.m_vMouseDelta.y = 0;
}
//g_vsObj->m_polySize = 0.1; //render each polygon in full screen size
g_vsObj->RenderDiffusion(pd3dDevice);
g_vsObj->Render(pd3dDevice);
if (g_showMenue)
{
DXUT_BeginPerfEvent(DXUT_PERFEVENTCOLOR, L"HUD / Stats");
g_HUD.OnRender(fElapsedTime);
g_SampleUI.OnRender(fElapsedTime);
RenderText();
DXUT_EndPerfEvent();
}
}