Share via


NuiInitialize

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Initializes the Kinect.

Syntax

HRESULT NuiInitialize(
         DWORD dwFlags
)

Parameters

  • dwFlags
    Type: DWORD
    [in] Specifies the Kinect subsystems to initialize, as a bitwise-OR combination of the NUI_INITIALIZE constants.

Return Value

Type: HRESULT
Returns S_OK if successful; otherwise, returns a failure code.

Remarks

Important

Applications can call NuiInitialize only once on a particular Kinect sensor. Subsequent calls to NuiInitialize will fail. This means that only one application can use the Kinect at any time.

The Kinect runtime processes data from the sensor in several processing stages. NuiInitialize initializes these stages that are required for the application, as specified by the value of the dwFlags parameter. The initialization flags also establish the image types and resolutions that are valid when calling the NuiImageStreamOpen method.

If the dwFlags parameter includes NUI_INITIALIZE_FLAG_USES_SKELETON, the skeleton tracking engine processes depth frames to generate the floor clipping plane that it returns in the NUI_SKELETON_FRAME structure. To enable applications to access this value, the runtime signals a skeleton frame event every time a depth frame is available, even if no skeleton is detected.

Note

If your application supports multiple sensors, use the INuiSensor interface to initialize the sensors instead.

If device status notifications are desired, NuiSetDeviceStatusCallback must be called before making any calls to NuiInitialize or NuiShutdown. There is a known issue for this method.

Requirements

Header: Declared in NuiApi.h.