Skip to content

Commit 37db321

Browse files
committed
Update c++ sample
1 parent e10fa4d commit 37db321

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

С++/GetData/GetData/GetData.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,25 @@ int main()
5959
return 1;
6060
}
6161

62-
DWORD iResult = GetHMDData(&myHMD);
62+
DWORD iResult = 0;
63+
6364
Sleep(300);
64-
GetHMDData(&myHMD);
65+
66+
while (true) {
67+
68+
iResult = GetHMDData(&myHMD);
69+
GetHMDData(&myHMD);
70+
71+
printf("Result = %d\n", iResult);
72+
printf("X = %f\nY = %f\nZ = %f\nYaw = %f\nPitch = %f\nRoll = %f\n\n", myHMD.X, myHMD.Y, myHMD.Z, myHMD.Yaw, myHMD.Pitch, myHMD.Roll);
6573

66-
printf("Result = %d\n", iResult);
67-
printf("X = %f\nY = %f\nZ = %f\nYaw = %f\nPitch = %f\nRoll = %f\n\n", myHMD.X, myHMD.Y, myHMD.Z, myHMD.Yaw, myHMD.Pitch, myHMD.Roll);
74+
system("cls");
75+
76+
if ((GetAsyncKeyState(VK_ESCAPE) & 0x8000) != 0 || (GetAsyncKeyState(VK_RETURN) & 0x8000) != 0) break;
77+
}
6878

6979
FreeLibrary(hDll);
7080
hDll = nullptr;
7181

72-
system("pause");
7382
return 0;
7483
}

0 commit comments

Comments
 (0)