本文整理汇总了C++中Animation::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::Draw方法的具体用法?C++ Animation::Draw怎么用?C++ Animation::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void Sprite::Draw(SDL_Rect *position, GameEngine *game, float gameTime, int direction)
{
Animation* temp;
temp = pAnimations->GetAnimation( current_behaviour );
temp->Draw(position, game, gameTime, direction);
}
示例2: Render
void Application::Render() {
if (!m_deviceLost) {
try {
//Create Matrices
D3DXMATRIX identity, world, view, proj, shadow;
D3DXMatrixIdentity(&identity);
D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(3.0f, 1.5f, 0.0f), &D3DXVECTOR3(0.0f, 1.0f, 0.0f), &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
D3DXMatrixPerspectiveFovLH(&proj, D3DX_PI / 4.0f, (float)WINDOW_WIDTH / (float)WINDOW_HEIGHT, 1.0f, 1000.0f);
D3DXPLANE ground(0.0f, 1.0f, 0.0f, 0.0f);
D3DXVECTOR4 lightPos(-50.0f, 75.0f, 50.0f, 0.0f);
D3DXMatrixShadow(&shadow, &lightPos, &ground);
g_pDevice->SetTransform(D3DTS_WORLD, &identity);
g_pDevice->SetTransform(D3DTS_VIEW, &view);
g_pDevice->SetTransform(D3DTS_PROJECTION, &proj);
// Clear the viewport
g_pDevice->Clear(0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0L);
// Begin the scene
if (SUCCEEDED(g_pDevice->BeginScene())) {
m_animation.Draw();
// End the scene.
g_pDevice->EndScene();
g_pDevice->Present(0, 0, 0, 0);
}
}
catch(...) {
g_debug << "Error in Application::Render() \n";
}
}
}