本文整理汇总了C++中GraphicsScene::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsScene::Update方法的具体用法?C++ GraphicsScene::Update怎么用?C++ GraphicsScene::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsScene
的用法示例。
在下文中一共展示了GraphicsScene::Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void Viewport::Draw()
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "" );
uint64_t start = Timer::GetTickCount();
if (!m_World)
{
return;
}
Camera& camera = m_Cameras[m_CameraMode];
GraphicsScene* pGraphicsScene = GetGraphicsScene();
GraphicsSceneView* pSceneView = pGraphicsScene->GetSceneView( m_SceneViewId );
BufferedDrawer* pDrawer = pGraphicsScene->GetSceneViewBufferedDrawer( m_SceneViewId );
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Setup Viewport and Projection" );
pSceneView->SetViewAndProjectionMatrices(
Simd::Matrix44( const_cast<Matrix4&>( camera.GetView() ).GetArray1d() ),
Simd::Matrix44( const_cast<Matrix4&>( camera.GetProjection() ).GetArray1d() )
);
}
pGraphicsScene->SetActiveSceneView( m_SceneViewId );
pGraphicsScene->Update( m_World.Get() );
pGraphicsScene->SetActiveSceneView( Invalid< uint32_t >() );
if (m_GridVisible)
{
m_GlobalPrimitives[GlobalPrimitives::StandardGrid]->Draw( pDrawer );
}
// this seems like a bad place to do this
if (m_Tool)
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Tool Evaluate" );
m_Tool->Evaluate();
}
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "PreRender" );
if (m_GridVisible)
{
m_GlobalPrimitives[GlobalPrimitives::StandardGrid]->Draw( pDrawer );
}
}
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Render" );
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Render Setup" );
m_RenderVisitor.Reset( this, pDrawer );
}
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Render Walk" );
m_Render.Raise( &m_RenderVisitor );
}
if (m_Tool)
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "Render Tool" );
m_Tool->Draw( pDrawer );
}
}
{
HELIUM_EDITOR_SCENE_RENDER_SCOPE_TIMER( "PostRender" );
//device->Clear(NULL, NULL, D3DCLEAR_ZBUFFER, 0, 1.0f, 0);
if (m_AxesVisible)
{
static_cast<Editor::PrimitiveAxes*>(m_GlobalPrimitives[GlobalPrimitives::ViewportAxes])->DrawViewport( pDrawer, &m_Cameras[m_CameraMode] );
}
if (m_Tool)
{
m_Tool->Draw( pDrawer );
}
#if VIEWPORT_REFACTOR
if ( m_Focused )
{
unsigned w = 3;
unsigned x = m_Size.x;
unsigned y = m_Size.y;
uint32_t color = D3DCOLOR_ARGB(255, 200, 200, 200);
std::vector< TransformedColored > vertices;
// <--
// | \ ^
// v \ |
//.........这里部分代码省略.........