Game Development Reference
In-Depth Information
coefficients. You'll also have to add some controls in the dialog window so that you can
change these variables when you run the program. Figure 4-5 shows how we added
these interface controls in the upper-right corner of the main window.
Figure 4-5. Revised cannon example screenshot
We also added these lines to the DemoDlgProc function to handle the new wind speed
and direction values:
//---------------------------------------------------------------------------------//
LRESULT CALLBACK DemoDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
//---------------------------------------------------------------------------------//
{
.
.
.
case WM_INITDIALOG:
.
.
.
// New variables:
sprintf( str, "%f", m );
SetDlgItemText(hDlg, IDC_M, str);
sprintf( str, "%f", Cd );
SetDlgItemText(hDlg, IDC_CD, str);
 
Search Nedrilad ::




Custom Search