/************************************************************** ** 函数名:SetCheckTmp/GetCheckTmp ** 功能:设置/获取Check的显示值 ** 注意事项: ***************************************************************/ void SetCheckTmp(DX_CHECK* the_check,bool tmp) { *(the_check->p_tmp)=tmp; if(IsWidgetAvailable((DX_WIDGET*)the_check)) { __SetOperationalWidget(the_check); __Draw(the_check); } }
/************************************************************** ** 函数名:ReDrawCheck ** 功能:重绘控件 ** 注意事项:用于一些刷新的重绘,不改变控件自身任何标志 ***************************************************************/ void ReDrawCheck(DX_CHECK *the_check) { //0.获取属性 __SetOperationalWidget(the_check); //1.画外框 __DrawFrame(the_check); //2.重绘内容 __Draw(the_check); }
void Octree::_Draw(OctreeGroup* Child) { __Draw(Child); if (Child->haveChilds) { for (uint32 i = 0; i < 8; i++) { _Draw(Child->childs[i]); } } }
/************************************************************** ** 函数名:GuiCheckDraw ** 功能:显示CHECK控件 ** 注意事项:此函数仅仅用于WINDOW出现的时候显示控件,不作重绘用 ***************************************************************/ void GuiCheckDraw(DX_CHECK *the_check) { //0.获取属性 __SetOperationalWidget(the_check); //1.完整性判断 __DebugChecking(the_check); //2.HIDE属性处理 if ((*(the_check->widget.p_ext_property))&EXT_PRO_HIDE) { return; } //3.内部处理 // .. //4.画外框 __DrawFrame(the_check); //5.重绘 __Draw(the_check); }
/************************************************************** ** 函数名:KeyToChangeCheck ** 功能:按键对CHECK的改变 ** 注意事项: *_*本函数还负责了重绘控件,可考虑不在这里重绘 ** 注意KeyToChangeXX系列,都不应对方向键有响应.方向键的响应又系统处理 ***************************************************************/ MESSAGE_WIDGET KeyToChangeCheck(DX_CHECK* the_check,GUIKEY key) { MESSAGE_WIDGET msg_widget=MESSAGE_NULL; bool reflash=FALSE; //DISABLE控件不处理 //if ((*(the_check->widget.p_ext_property))&EXT_PRO_DISABLE) // return MESSAGE_NULL; //回车 if (key==KEY_TO_GUI_ENTER) { msg_widget=MESSAGE_WIDGET_ENTER; reflash=FALSE; } //编辑 else if((KEY_TO_GUI_0<key)&&(KEY_TO_GUI_9)) { if(*(the_check->p_tmp)==TRUE) { *(the_check->p_tmp)=FALSE; } else { *(the_check->p_tmp)=TRUE; } msg_widget=MESSAGE_WIDGET_EDIT; reflash=TRUE; } //重绘 if(reflash==TRUE) { //获取基本属性 __SetOperationalWidget(the_check); //重绘 __Draw(the_check); } return msg_widget; }
//------------------------------------------------------------------------- bool CCameraTest::Display(float timeDelta) { if (0 == m_Device) { return false; } // 计算摄像机角度 { if( ::GetAsyncKeyState('W') & 0x8000f ) m_CameraMgr.Walk(4.0f * timeDelta); if( ::GetAsyncKeyState('S') & 0x8000f ) m_CameraMgr.Walk(-4.0f * timeDelta); if( ::GetAsyncKeyState('A') & 0x8000f ) m_CameraMgr.Strafe(-4.0f * timeDelta); if( ::GetAsyncKeyState('D') & 0x8000f ) m_CameraMgr.Strafe(4.0f * timeDelta); if( ::GetAsyncKeyState('R') & 0x8000f ) m_CameraMgr.Fly(4.0f * timeDelta); if( ::GetAsyncKeyState('F') & 0x8000f ) m_CameraMgr.Fly(-4.0f * timeDelta); if( ::GetAsyncKeyState(VK_UP) & 0x8000f ) m_CameraMgr.Pitch(1.0f * timeDelta); if( ::GetAsyncKeyState(VK_DOWN) & 0x8000f ) m_CameraMgr.Pitch(-1.0f * timeDelta); if( ::GetAsyncKeyState(VK_LEFT) & 0x8000f ) m_CameraMgr.Yaw(-1.0f * timeDelta); if( ::GetAsyncKeyState(VK_RIGHT) & 0x8000f ) m_CameraMgr.Yaw(1.0f * timeDelta); if( ::GetAsyncKeyState('N') & 0x8000f ) m_CameraMgr.Roll(1.0f * timeDelta); if( ::GetAsyncKeyState('M') & 0x8000f ) m_CameraMgr.Roll(-1.0f * timeDelta); } // Update the view matrix representing the cameras // new position/orientation. D3DXMATRIX V; m_CameraMgr.GetViewMatrix(&V); m_Device->SetTransform(D3DTS_VIEW, &V); m_Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); m_Device->BeginScene(); __Draw(1.0f); m_Device->EndScene(); return true; }