Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

NuiCreateSensorByIndex

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Creates an instance of the Kinect sensor with the specified index so that an application can open and use it.

HRESULT NuiCreateSensorByIndex(
         int index,
         INuiSensor **ppNuiSensor
)

Parameters

index
Type: int
[in] The zero-based index of the Kinect sensor to open. Valid values range from zero to one less than the value returned by the NuiGetSensorCount function.
ppNuiSensor
Type: INuiSensor
[out] A pointer that receives a reference to the created INuiSensor interface.

Return Value

Type: HRESULT
Returns S_OK if successful; otherwise, returns one of the failure codes in the following table.
ErrorDescription
E_OUTOFMEMORYThe allocation failed.
E_POINTERThe hNextFrameEvent parameter is an invalid handle.

JJ663848.note(en-us,IEB.10).gifNote
This function supports applications that use more than one Kinect sensor. Applications that use only one sensor do not need an INuiSensor interface, and should use the functions in NuiApi.h, NuiImageCamera.h, and NuiSkeleton.h.

Applications that support more than one Kinect sensor call NuiCreateSensorByIndex to access the second and subsequent devices. This function returns a pointer to an INuiSensor interface, which provides functions that are identical to those in NuiApi.h, NuiImageCamera.h, and NuiSkeleton.h, but operate on a particular device instance.

Header: Declared in NuiSensor.h; however, include NuiApi.h in your project.

Community Additions

ADD
Show:
© 2015 Microsoft