c++平台判断

来源:互联网 发布:ipad开单软件 编辑:程序博客网 时间:2024/06/05 03:56
 bool Device_ScriptObject::get_ipad()//是不是IPAD?
    {
        return cocos2d::Application::Platform::OS_IPAD == cocos2d::Application::getInstance()->getTargetPlatform() ? true : false;

    }


    bool Device_ScriptObject::get_ios()
    {
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
        return true;
#else
        return false;
#endif

    }

    bool Device_ScriptObject::get_mobile()//是不是移动端?
    {
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS
        return true;
#else
        return false;
#endif
    }

0 0
原创粉丝点击