跨平台类的写法
来源:互联网 发布:苹果删除不了软件 编辑:程序博客网 时间:2024/05/22 14:24
跨平台类的写法
有如下代码
void AudioEngine::playMusic(const std::string& fileName,bool bLoop /* = false */){stopMusic();if (m_bgmEnabled){#if (TARGET_PLATFORM == PLATFORM_WIN32)AudioEngineWin::playBackgroundMusic(fileName.c_str(),bLoop);#elif (TARGET_PLATFORM == PLATFORM_ANDROID)AudioEngineAndroid::playBackgroundMusic(fileName.c_str(),bLoop);#elif (TARGET_PLATFORM == PLATFORM_IOS)AudioEngineIos::playBackgroundMusic(fileName.c_str(),bLoop);#endif}}
实际上的写法应是
void AudioEngine::playMusic(const std::string& fileName,bool bLoop /* = false */){stopMusic();if (m_bgmEnabled){AudioEngineCore::playBackgroundMusic(fileName.c_str(),bLoop);}}
在编译过程中根据不同平台,指定相应的cpp
0 0
- 跨平台类的写法
- 跨平台模板的写法
- 跨平台宏的写法
- 跨平台函数指针的写法
- NetBeans平台中打开文件的写法
- Qt:平台相关的代码写法
- Qt:平台相关的代码写法
- Qt Creator中.pro跨平台(Win32\Linux)的写法
- Qt Creator中.pro跨平台(Win32\Linux)的写法
- linux平台设备驱动程序的写法之操作led灯
- Javascript类的写法
- Javascript类的写法
- php 类的写法
- Javascript类的写法
- javascript类的写法
- 第一节,类的写法
- 数据库连接类的写法
- 监听类的写法
- EBS应付AP查询脚本
- 面向连接和无连接
- 输入a,b,c的值,求一元二次方程的解
- C++编译错误 - [Error] stray '\241' in progarm
- RHEL 6.0安装Qt
- 跨平台类的写法
- js keycode 列表一览
- Hdu 1576 A/B[乘法逆元]
- Nginx的配置与部署(8)核心模块之事件模块常用指令
- python StringIO
- 使用DNSCrypt解决DNS污染问题
- 安卓 ANR 原因,解决方法
- Grizzly 2.3.17 API文档CHM版
- 网卡无法获取IP地址的解法