Graphics Reference
In-Depth Information
void CTutorialDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar) {
// Determine which of the scroll bars triggered the event
if (pScrollBar == (CScrollBar * )&m _ VelocityXSlider)
{
pBall = theApp.GetModel().SelectedBall();
if (pBall) {
pBall->SetVelocity( // with value updated from the slider bar );
}
} else if (pScrollBar == (CScrollBar * )&m _ VelocityYSlider) {
// code similar to above, operating on the y-component of velocity
.
}
Listing 5.26. CTutorial::OnHScroll() function (Tutorial 5.6).
Source file.
TutorialDlg.cpp file in the
Source Files
folder
of
the
D3D _ BallShoot project.
Search WWH ::




Custom Search