当前位置: 首页 > news >正文

丽江建设工程信息网站不限关键词做网站平台

丽江建设工程信息网站,不限关键词做网站平台,如何查公司的工商注册信息,国有企业投资建设项目InputCaps处理外部输入的事件 该例子主要由两部分内容#xff1a; 外部输入事件获取 ​ 可以处理keyboard、mouse、joystick、touch、sensor的输入事件 显示一个ui图标按钮 Input 定义监听事件类型#xff1a; KlayGE::InputActionDefine actions[] {InputActionDefin…InputCaps处理外部输入的事件 该例子主要由两部分内容 外部输入事件获取 ​ 可以处理keyboard、mouse、joystick、touch、sensor的输入事件 显示一个ui图标按钮 Input 定义监听事件类型 KlayGE::InputActionDefine actions[] {InputActionDefine(KeyboardMsg, KS_AnyKey),InputActionDefine(MouseMsg, MS_X),InputActionDefine(MouseMsg, MS_Y),InputActionDefine(MouseMsg, MS_Z),InputActionDefine(MouseMsg, MS_AnyButton),InputActionDefine(JoystickMsg, JS_LeftThumbX),InputActionDefine(JoystickMsg, JS_LeftThumbY),InputActionDefine(JoystickMsg, JS_LeftThumbZ),InputActionDefine(JoystickMsg, JS_RightThumbX),InputActionDefine(JoystickMsg, JS_RightThumbY),InputActionDefine(JoystickMsg, JS_RightThumbZ),InputActionDefine(JoystickMsg, JS_LeftTrigger),InputActionDefine(JoystickMsg, JS_RightTrigger),InputActionDefine(JoystickMsg, JS_AnyButton),InputActionDefine(TouchMsg, TS_Pan),InputActionDefine(TouchMsg, TS_Tap),InputActionDefine(TouchMsg, TS_Press),InputActionDefine(TouchMsg, TS_PressAndTap),InputActionDefine(TouchMsg, TS_Zoom),InputActionDefine(TouchMsg, TS_Rotate),InputActionDefine(TouchMsg, TS_Flick),InputActionDefine(TouchMsg, TS_Wheel),InputActionDefine(TouchMsg, TS_AnyTouch),InputActionDefine(SensorMsg, SS_AnySensing),InputActionDefine(Exit, KS_Escape)}; } 在OnCreate中绑定事件监听 KlayGE::InputEngine inputEngine KlayGE::Context::Instance().InputFactoryInstance().InputEngineInstance();KlayGE::InputActionMap actionMap;actionMap.AddActions(actions, actions std::size(actions));action_handler_t input_handler MakeSharedPtrinput_signal();input_handler-Connect([this](InputEngine const sender, InputAction const action){this-InputHandler(sender, action);});inputEngine.ActionMap(actionMap, input_handler); // 获取joystic_设备for (size_t i 0; i inputEngine.NumDevices(); i){auto const device inputEngine.Device(i);if (device-Type() InputEngine::IDT_Joystick){joystick_ checked_pointer_castInputJoystick(device);}}主要的消息处理函数InputHandler实现 void InputCaps::InputHandler(KlayGE::InputEngine const sender, KlayGE::InputAction const action) {switch (action.first){case KeyboardMsg:{key_str_.clear();InputKeyboardActionParamPtr param checked_pointer_castInputKeyboardActionParam(action.second);for (uint32_t i 0; i 0xEF; i){if (param-buttons_state[i]){key_str_ key_name[i] L ;}}}break;case MouseMsg:{InputMouseActionParamPtr param checked_pointer_castInputMouseActionParam(action.second);std::wostringstream stream;stream param-abs_coord.x() param-abs_coord.y() ;stream param-move_vec.x() param-move_vec.y() param-wheel_delta ;for (uint32_t i 0; i 8; i){if (param-buttons_state (1UL i)){stream button i L ;}}mouse_str_ stream.str();}break;case JoystickMsg:{InputJoystickActionParamPtr param checked_pointer_castInputJoystickActionParam(action.second);std::wostringstream stream;stream param-thumbs[0].x() param-thumbs[0].y() param-thumbs[0].z() ;stream param-thumbs[1].x() param-thumbs[1].y() param-thumbs[1].z() ;stream param-triggers[0] param-triggers[1] ;for (uint32_t i 0; i 16; i){if (param-buttons_state (1UL i)){stream button i L ;}}joystick_str_ stream.str();if (joystick_){for (uint32_t i 0; (i joystick_-NumVibrationMotors()) (i 2); i){joystick_-VibrationMotorSpeed(i, param-triggers[i]);}}}break;case TouchMsg:{InputTouchActionParamPtr param checked_pointer_castInputTouchActionParam(action.second);std::wostringstream stream;stream touch_name[param-gesture - 0x300] ;if (param-gesture ! TS_None){stream center param-center.x() param-center.y() ;switch (param-gesture){case TS_Pan:case TS_Tap:case TS_Flick:stream move param-move_vec.x() param-move_vec.y() ;break;case TS_Zoom:stream factor param-zoom ;break;case TS_Rotate:stream angle param-rotate_angle ;break;default:break;}}if (param-wheel_delta ! 0){stream Wheel param-wheel_delta ;}for (uint32_t i 0; i 16; i){if (param-touches_down (1UL i)){stream Touch i L Down ;}if (param-touches_up (1UL i)){stream Touch i L Up ;}}touch_str_ stream.str();}break;case SensorMsg:{InputSensorActionParamPtr param checked_pointer_castInputSensorActionParam(action.second);std::wostringstream stream;stream Lat: param-latitude Lng: param-longitude;stream Orientation: param-orientation_quat.x() param-orientation_quat.y() param-orientation_quat.z() param-orientation_quat.w();sensor_str_ stream.str();}break;case Exit:this-Quit();break;} }UI ui使用内置的ui解析脚本uiml格式文件,从外部获取一个特定尺寸的图片作为按钮显示在指定位置 ?xml version1.0 encodingutf-8 standaloneno? uidialog idLogo captionLogo x-128 y0 align_xright align_ytop width128 height128 show_captionfalse opacitytrue bg_color_a0control typetex_button idLogoButton texturepowered_by_klayge.dds x0 y0 width128 height128 is_default0//dialog /ui在OnCreate函数中加载ui资源 KlayGE::UIManager::Instance().Load(*KlayGE::ResLoader::Instance().Open(InputCaps.uiml));在DoUpdateOverlay函数中渲染 KlayGE::UIManager::Instance().Render();在Onsize时更新 KlayGE::UIManager::Instance().SettleCtrls();编写本例子遇到的坑 以下类无法找到link失败 1InputCaps.obj : error LNK2019: 无法解析的外部符号 __declspec(dllimport) class std::unique_ptrclass KlayGE::Signal::Detail::Mutex,struct std::default_deleteclass KlayGE::Signal::Detail::Mutex __cdecl KlayGE::Signal::Detail::CreateMutexA(void) (__imp_?CreateMutexADetailSignalKlayGEYA?AV?$unique_ptrVMutexDetailSignalKlayGEU?$default_deleteVMutexDetailSignalKlayGEstdstdXZ)函数 public: __cdecl KlayGE::Signal::Detail::SignalTemplateBasevoid __cdecl(class KlayGE::InputEngine const ,struct std::pairunsigned short,class std::shared_ptrstruct KlayGE::InputActionParam const ),struct KlayGE::Signal::CombinerDefaultvoid ::SignalTemplateBasevoid __cdecl(class KlayGE::InputEngine const ,struct std::pairunsigned short,class std::shared_ptrstruct KlayGE::InputActionParam const ),struct KlayGE::Signal::CombinerDefaultvoid (void) (??0?$SignalTemplateBase$$A6AXAEBVInputEngineKlayGEAEBU?$pairGV?$shared_ptrUInputActionParamKlayGEstdstdZU?$CombinerDefaultXSignal2DetailSignalKlayGEQEAAXZ) 中引用了该符号 1F:\code\project\test\Learning.test\GFX\KlayGE\KlayGELearning\bin\Debug\InputCaps.exe : fatal error LNK1120: 1 个无法解析的外部命令意思就是找不到这个函数 __declspec(dllimport) class std::unique_ptrclass KlayGE::Signal::Detail::Mutex,struct std::default_deleteclass KlayGE::Signal::Detail::Mutex __cdecl KlayGE::Signal::Detail::CreateMutexA(void)在KlayGE_Core_vc142.dll中只找到了这个 class std::unique_ptrclass KlayGE::Signal::Detail::Mutex,struct std::default_deleteclass KlayGE::Signal::Detail::Mutex __cdecl KlayGE::Signal::Detail::CreateMutexW(void) 很明显CreateMutex是windows kernel32中的api函数但KlayGE却导出了一个同名的函数导致函数签名错误。KlayGE默认使用unicode字符集我的项目未设置使用了多字节结果就成了CreateMutexA。 最终的解决办法 ADD_DEFINITIONS(-DUNICODE -D_UNICODE)但是最好不要让自己的函数名称和常用库的API同名这里出现冲突也和window的unicode使用宏定义有很大原因如下 #ifdef UNICODE #define CreateMutex CreateMutexW #else #define CreateMutex CreateMutexA #endif // !UNICODE最终效果 源码 KlayGE学习主目录
http://www.w-s-a.com/news/58835/

相关文章:

  • 自己搭建服务器做视频网站wordpress发布文章 发布
  • php仿博客园网站阅读分享网站模板
  • 网站宣传的劣势域名注册长沙有限公司
  • 怎样联系自己建设网站企业怎样做好网站建设
  • 网站制作需求分析电商网站建设浩森宇特
  • 淄博网站建设招聘摄影网站建设的论文
  • 怎么把凡科网里做的网站保存成文件网站建设研究的意义
  • 服务器2003怎么做网站网站建设服务器的配置
  • 高校网站建设方案网站推广软件下载安装免费
  • 重庆没建网站的企业网站开发软件 连接SQL数据库
  • 百度申诉网站沉默是金
  • 如何自己建网站wordpress图片延时加载
  • 甘肃省住房和城乡建设厅注册中心网站千博企业网站管理系统2013
  • 西餐厅网站模板seo搜索引擎优化ppt
  • 什么做的网站吗wordpress注册可见插件
  • 献县做网站价格可以提升自己的网站
  • 如何修改网站title建设网站只能是公司
  • 网站推广效果怎么样建设工程公司组织架构图
  • 成都制作网站价格表网站安全证书过期怎么办
  • 高校图书馆网站的建设方案湖南常德市
  • 房地产怎么做网站推广wordpress插件汉化下载
  • 一般pr做视频过程那个网站有无锡网络公司平台
  • 安徽网站推广系统网站根目录权限设置
  • 班级网站建设需求智慧校园登录入口
  • asp.net网站发布到虚拟主机电商设计网站哪个好
  • 做的网站怎么转成网址链接企业为什么要找会计
  • 关于建设网站的情况说明书文化建设方面的建议
  • 订票网站开发公司大通证券手机版下载官方网站下载
  • 网店美工的意义与发展佛山推广seo排名
  • 网站在建设中模板自助云商城