Graphics Reference
In-Depth Information
{
//Always allow dialog resource manager calls to handle global
//messages so GUI state is updated correctly
*pbNoFurtherProcessing = g_DialogResourceManager.MsgProc(hWnd, uMsg,
wParam, lParam);
if(*pbNoFurtherProcessing)
return 0;
if(g_SettingsDlg.IsActive())
{
g_SettingsDlg.MsgProc(hWnd, uMsg, wParam, lParam);
return 0;
}
//Give the dialogs a chance to handle the message first
*pbNoFurtherProcessing = g_HUD.MsgProc(hWnd, uMsg, wParam, lParam);
if(*pbNoFurtherProcessing)
return 0;
*pbNoFurtherProcessing = g_SampleUI.MsgProc(hWnd, uMsg, wParam,
lParam);
if(*pbNoFurtherProcessing)
return 0;
//Pass all remaining windows messages to camera so it can respond to
user input
g_Camera.HandleMessages(hWnd, uMsg, wParam, lParam);
return 0;
}
//—————————————————————————————————————————————————————————————————————————
//Handle key presses
//—————————————————————————————————————————————————————————————————————————
void CALLBACK KeyboardProc(UINT nChar, bool bKeyDown, bool bAltDown,
void* pUserContext)
{
IDirect3DCubeTexture9* pCubeTexture = NULL;
if(bKeyDown)
{
switch(nChar)
{
case VK_F1:
g_bShowHelp = !g_bShowHelp; break;
case VK_F4:
if (++g_CurrentModel = = g_ModelCount)
g_CurrentModel = 0;
LoadMesh(DXUTGetD3D9Device(), g_CurrentModel);
break;
case '1':
g_CurrentModel = 0;
LoadMesh(DXUTGetD3D9Device(), g_CurrentModel);
break;
case '2':
g_CurrentModel = 1;
LoadMesh(DXUTGetD3D9Device(), g_CurrentModel);
break;
Search WWH ::




Custom Search