为了方便查看,添加了一些菜单功能
实现起来也很简单,点击菜单就是bool值的转换而已,然后在frameStarted里面更新:
1, 做一个全局的静态类来保存这些全局的bool值变量,因为这些变量要跨几个文件用到,需要全局的,
2, 自己添加ON_COMMAND消息,并实现消息响应函数,函数就是bool值的转换而已
3, 添加ON_UPDATE_COMMAND_UI消息,并实现消息响应函数,处理菜单的状态,主要用来显示菜单的对勾
4, 在frameStarted更新状态,设置显示还是不显示,有点麻烦的是要保存所有对象的指针....从场景管理器里面好像不好弄出来
- /************************************************************************/
- /* @author LYN 2009.11.6 QQ:18052887 */
- /************************************************************************/
- /************************************************************************/
- /* @remarks 静态公有类, 放置一些静态的全局变量供所有类调用 */
- /************************************************************************/
- class CPublic
- {
- public:
- CPublic(){}
- virtual ~CPublic(){}
- static bool m_fogEnable;
- static bool m_lightEnable;
- static bool m_StaticEntityEnable;
- static bool m_modelEnable;
- static bool m_particleSystemEnable;
- static bool m_terrainLiquidEnable;
- static bool m_wCollisionEnable;
- static bool m_soundEnable;
- static bool m_soundPositionEnable;
- static bool m_bloomEnable;
- static bool m_miniMapEnable;
- static bool m_debugOverlayEnable;
- static bool m_freeCameraEnable;
- };
- /************************************************************************/
- /* @author LYN 2009.11.6 QQ:18052887 */
- /************************************************************************/
- #include "stdafx.h"
- #include "CPublic.h"
- // 初始化静态成员变量
- bool CPublic::m_fogEnable = true;
- bool CPublic::m_lightEnable = true;
- bool CPublic::m_StaticEntityEnable = true;
- bool CPublic::m_modelEnable = true;
- bool CPublic::m_particleSystemEnable = true;
- bool CPublic::m_terrainLiquidEnable = true;
- bool CPublic::m_wCollisionEnable = false;
- bool CPublic::m_soundEnable = true;
- bool CPublic::m_soundPositionEnable = false;
- bool CPublic::m_bloomEnable = false;
- bool CPublic::m_miniMapEnable = false;
- bool CPublic::m_debugOverlayEnable = true;
- bool CPublic::m_freeCameraEnable = true;