mirror of
https://github.com/hyblocker/OpenVR-SpaceCalibrator.git
synced 2026-10-26 14:01:19 +01:00
Update to OpenVR v1.10.30
This commit is contained in:
1 parent
eebf2877f3
commit
c607fa30c4
6 files changed
+3496
-549
No files matched your search
@@ -14,7 +14,10 @@ static void ParseProfileV2(CalibrationContext &ctx, std::istream &stream);
|
||||
|
||||
static std::string ConfigFileName()
|
||||
{
|
||||
std::string vrRuntimeConfigName = vr::VR_RuntimePath();
|
||||
char cruntimePath[MAX_PATH] = { 0 };
|
||||
unsigned int pathLen;
|
||||
vr::VR_GetRuntimePath(cruntimePath, MAX_PATH, &pathLen);
|
||||
std::string vrRuntimeConfigName(cruntimePath);
|
||||
return vrRuntimeConfigName + "\\..\\..\\..\\config\\01spacecalibrator\\calibration.json";
|
||||
}
|
||||
|
||||
@@ -200,9 +203,7 @@ static void UpgradeProfileV1(CalibrationContext &ctx)
|
||||
|
||||
void WriteActivateMultipleDriversToConfig()
|
||||
{
|
||||
std::string configPath = vr::VR_RuntimePath();
|
||||
configPath += "\\..\\..\\..\\config\\steamvr.vrsettings";
|
||||
|
||||
std::string configPath = ConfigFileName();
|
||||
std::ifstream ifile(configPath);
|
||||
if (!ifile.good())
|
||||
throw std::runtime_error("failed to read steamvr.vrsettings");
|
||||
|
||||
@@ -119,7 +119,7 @@ void TryCreateVROverlay()
|
||||
|
||||
vr::VROverlay()->SetOverlayWidthInMeters(overlayMainHandle, 3.0f);
|
||||
vr::VROverlay()->SetOverlayInputMethod(overlayMainHandle, vr::VROverlayInputMethod_Mouse);
|
||||
vr::VROverlay()->SetOverlayFlag(overlayMainHandle, vr::VROverlayFlags_SendVRScrollEvents, true);
|
||||
vr::VROverlay()->SetOverlayFlag(overlayMainHandle, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true);
|
||||
|
||||
std::string iconPath = cwd;
|
||||
iconPath += "\\icon.png";
|
||||
@@ -192,10 +192,11 @@ void RunLoop()
|
||||
char buf[0x400];
|
||||
ImGui::GetActiveText(buf, sizeof buf);
|
||||
buf[0x3ff] = 0;
|
||||
uint32_t unFlags = 0; // EKeyboardFlags
|
||||
|
||||
vr::VROverlay()->ShowKeyboardForOverlay(
|
||||
overlayMainHandle, vr::k_EGamepadTextInputModeNormal, vr::k_EGamepadTextInputLineModeSingleLine,
|
||||
"Space Calibrator Overlay", sizeof buf, buf, false, 0
|
||||
unFlags, "Space Calibrator Overlay", sizeof buf, buf, 0
|
||||
);
|
||||
keyboardOpen = true;
|
||||
}
|
||||
@@ -214,7 +215,7 @@ void RunLoop()
|
||||
case vr::VREvent_MouseButtonUp:
|
||||
io.MouseDown[vrEvent.data.mouse.button == vr::VRMouseButton_Left ? 0 : 1] = false;
|
||||
break;
|
||||
case vr::VREvent_Scroll:
|
||||
case vr::VREvent_ScrollDiscrete:
|
||||
io.MouseWheelH += vrEvent.data.scroll.xdelta * 360.0f * 8.0f;
|
||||
io.MouseWheel += vrEvent.data.scroll.ydelta * 360.0f * 8.0f;
|
||||
break;
|
||||
@@ -342,7 +343,11 @@ static void HandleCommandLine(LPWSTR lpCmdLine)
|
||||
vr::VR_Init(&vrErr, vr::VRApplication_Utility);
|
||||
if (vrErr == vr::VRInitError_None)
|
||||
{
|
||||
printf("%s", vr::VR_RuntimePath());
|
||||
char cruntimePath[MAX_PATH] = { 0 };
|
||||
unsigned int pathLen;
|
||||
vr::VR_GetRuntimePath(cruntimePath, MAX_PATH, &pathLen);
|
||||
|
||||
printf("%s", cruntimePath);
|
||||
vr::VR_Shutdown();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+1981
-351
File diff suppressed because it is too large.
Load diff
+1501
-190
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user