int main() { XnStatus nRetVal = XN_STATUS_OK; Context context; EnumerationErrors errors; nRetVal = context.Init(); CHECK_RC(nRetVal, "Init context"); RotatingDevice rotatingDevice; nRetVal = rotatingDevice.Create(context); if (nRetVal != XN_STATUS_OK) { printf("Create Rotating Device failed: %s\n\n", xnGetStatusString(nRetVal)); printf("In order to run this sample, NiSampleExtensionModule must be registered with OpenNI.\n"); printf("Please run:\n"); printf("\tniReg NiSampleExtensionModule.dll\n"); printf("before running this sample, and\n"); printf("\tniReg -u NiSampleExtensionModule.dll\n"); printf("afterwards.\n"); return nRetVal; } nRetVal = rotatingDevice.SetViewAngle(2.17); CHECK_RC(nRetVal, "Create Rotating Device"); nRetVal = rotatingDevice.PlayBeep(); CHECK_RC(nRetVal, "Play Beep"); return 0; }
int main() { XnStatus nRetVal = XN_STATUS_OK; Context context; EnumerationErrors errors; nRetVal = context.Init(); CHECK_RC(nRetVal, "Init context"); RotatingDevice rotatingDevice; nRetVal = rotatingDevice.Create(context); CHECK_RC(nRetVal, "Create Rotating Device"); nRetVal = rotatingDevice.SetViewAngle(2.17); CHECK_RC(nRetVal, "Create Rotating Device"); nRetVal = rotatingDevice.PlayBeep(); CHECK_RC(nRetVal, "Play Beep"); return 0; }