用于查看Kinect是否已插入的事件或标志 [英] Event or flag to see if Kinect is plugged in

查看:90
本文介绍了用于查看Kinect是否已插入的事件或标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果没有找到kinect,我希望我的程序发出警报,然后在用户将kinect插入电脑时非阻塞地告诉我。什么是最简单的方法。如果重要,我使用Beta 2 sdk而不是最新版本。谢谢!

I want my program to alert if no kinect is found and then non-blockingly tell me when the user plugs in the kinect to the pc. What's the easiest way to do this. If it matters, i'm using the Beta 2 sdk rather than the newest version. Thanks!

推荐答案

嘿,

我正在使用实际的SDK,但它也适用于较旧的SDK 。可以使用NuiCreateSensorByIndex的HRESULT:

I'm using the actual SDK but it should also works with older SDK's. The HRESULT of NuiCreateSensorByIndex can be used:

hr = NuiCreateSensorByIndex(0, &m_pNuiSensor);

if (FAILED(hr))
    cout << "no kinect";

您可以循环运行此代码,直到找到Kinect。

You can run this code in a loop until a Kinect is found.


这篇关于用于查看Kinect是否已插入的事件或标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆