Skip to content

Commit 0be692d

Browse files
committed
Convert to .NET 8, add EasyOpenVR
1 parent 4484709 commit 0be692d

10 files changed

Lines changed: 108 additions & 8314 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "EasyOpenVR"]
2+
path = EasyOpenVR
3+
url = https://github.com/BOLL7708/EasyOpenVR.git

EasyOpenVR

Submodule EasyOpenVR added at b4f0580

OpenVRStartup.sln

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29806.167
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenVRStartup", "OpenVRStartup\OpenVRStartup.csproj", "{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenVRStartup", "OpenVRStartup\OpenVRStartup.csproj", "{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyOpenVR", "EasyOpenVR\EasyOpenVR.csproj", "{0043999F-283C-40D9-AE8B-C80E693C5C84}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -21,6 +23,14 @@ Global
2123
{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}.Release|Any CPU.Build.0 = Release|Any CPU
2224
{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}.Release|x64.ActiveCfg = Release|x64
2325
{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}.Release|x64.Build.0 = Release|x64
26+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Debug|x64.ActiveCfg = Debug|Any CPU
29+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Debug|x64.Build.0 = Debug|Any CPU
30+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Release|x64.ActiveCfg = Release|Any CPU
33+
{0043999F-283C-40D9-AE8B-C80E693C5C84}.Release|x64.Build.0 = Release|Any CPU
2434
EndGlobalSection
2535
GlobalSection(SolutionProperties) = preSolution
2636
HideSolutionNode = FALSE

OpenVRStartup/LogUtils.cs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,39 @@
55

66
namespace OpenVRStartup
77
{
8-
9-
static class LogUtils
8+
internal static class LogUtils
109
{
11-
static List<string> cache = new List<string>();
10+
static List<string> cache = [];
1211

13-
static public void WriteLineToCache(string line) {
14-
string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
12+
public static void WriteLineToCache(string line)
13+
{
14+
var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
1515
cache.Add($"{time} {line}");
1616
}
1717

18-
static public void FlushCache() {
18+
static public void FlushCache()
19+
{
1920
cache.Clear();
2021
}
2122

22-
static public bool LogFileExists(string filePath) {
23+
public static bool LogFileExists(string filePath)
24+
{
2325
return File.Exists(filePath);
2426
}
2527

26-
static public void WriteCacheToLogFile(string filePath, int lineLimit) {
27-
var linesArr = File.Exists(filePath) ? File.ReadAllLines(filePath) : new string[0];
28+
public static void WriteCacheToLogFile(string filePath, int lineLimit)
29+
{
30+
var linesArr = File.Exists(filePath) ? File.ReadAllLines(filePath) : [];
2831
var linesList = linesArr.ToList();
2932
linesList.AddRange(cache);
3033
if (linesList.Count > lineLimit)
3134
{
32-
linesList.RemoveRange(0, linesList.Count-lineLimit);
35+
linesList.RemoveRange(0, linesList.Count - lineLimit);
3336
linesList.Insert(0, $"(Log is limited to {lineLimit} lines and has been truncated)");
3437
}
38+
3539
File.WriteAllText(filePath, string.Join("\n", linesList));
3640
FlushCache();
3741
}
3842
}
39-
}
43+
}

OpenVRStartup/OpenVRStartup.csproj

Lines changed: 59 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,60 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{829A73D2-D74D-4751-A8AF-D3290E3C2FCD}</ProjectGuid>
8-
<OutputType>Exe</OutputType>
9-
<RootNamespace>OpenVRStartup</RootNamespace>
10-
<AssemblyName>OpenVRStartup</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14-
<Deterministic>true</Deterministic>
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
</PropertyGroup>
35-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
36-
<DebugSymbols>true</DebugSymbols>
37-
<OutputPath>bin\x64\Debug\</OutputPath>
38-
<DefineConstants>DEBUG;TRACE</DefineConstants>
39-
<DebugType>full</DebugType>
40-
<PlatformTarget>x64</PlatformTarget>
41-
<LangVersion>7.3</LangVersion>
42-
<ErrorReport>prompt</ErrorReport>
43-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
44-
<Prefer32Bit>true</Prefer32Bit>
45-
</PropertyGroup>
46-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
47-
<OutputPath>bin\x64\Release\</OutputPath>
48-
<DefineConstants>TRACE</DefineConstants>
49-
<Optimize>true</Optimize>
50-
<DebugType>pdbonly</DebugType>
51-
<PlatformTarget>x64</PlatformTarget>
52-
<LangVersion>7.3</LangVersion>
53-
<ErrorReport>prompt</ErrorReport>
54-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
55-
<Prefer32Bit>true</Prefer32Bit>
56-
</PropertyGroup>
57-
<PropertyGroup>
58-
<StartupObject />
59-
</PropertyGroup>
60-
<PropertyGroup>
61-
<ApplicationIcon>resources\logo.ico</ApplicationIcon>
62-
</PropertyGroup>
63-
<ItemGroup>
64-
<Reference Include="System" />
65-
<Reference Include="System.Core" />
66-
<Reference Include="System.Drawing" />
67-
<Reference Include="System.Xml.Linq" />
68-
<Reference Include="System.Data.DataSetExtensions" />
69-
<Reference Include="Microsoft.CSharp" />
70-
<Reference Include="System.Data" />
71-
<Reference Include="System.Net.Http" />
72-
<Reference Include="System.Xml" />
73-
</ItemGroup>
74-
<ItemGroup>
75-
<Compile Include="LogUtils.cs" />
76-
<Compile Include="openvr_api.cs" />
77-
<Compile Include="Program.cs" />
78-
<Compile Include="Properties\AssemblyInfo.cs" />
79-
<Compile Include="Properties\Resources.Designer.cs">
80-
<AutoGen>True</AutoGen>
81-
<DesignTime>True</DesignTime>
82-
<DependentUpon>Resources.resx</DependentUpon>
83-
</Compile>
84-
<Compile Include="Utils.cs" />
85-
</ItemGroup>
86-
<ItemGroup>
87-
<None Include="App.config" />
88-
<None Include="app.vrmanifest">
89-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
90-
</None>
91-
<None Include="start\demo_start.cmd">
92-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
93-
</None>
94-
<None Include="stop\demo_stop.cmd">
95-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
96-
</None>
97-
</ItemGroup>
98-
<ItemGroup>
99-
<None Include="examples\restart_voicemeeter_audio_engine.cmd">
100-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
101-
</None>
102-
<None Include="openvr_api.dll">
103-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
104-
</None>
105-
</ItemGroup>
106-
<ItemGroup>
107-
<EmbeddedResource Include="Properties\Resources.resx">
108-
<Generator>ResXFileCodeGenerator</Generator>
109-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
110-
</EmbeddedResource>
111-
</ItemGroup>
112-
<ItemGroup />
113-
<ItemGroup>
114-
<Content Include="resources\logo.ico" />
115-
</ItemGroup>
116-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<OutputType>Exe</OutputType>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
9+
<OutputPath>bin\x64\Debug\</OutputPath>
10+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
11+
</PropertyGroup>
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
13+
<OutputPath>bin\x64\Release\</OutputPath>
14+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
15+
</PropertyGroup>
16+
<PropertyGroup>
17+
<StartupObject />
18+
</PropertyGroup>
19+
<PropertyGroup>
20+
<ApplicationIcon>resources\logo.ico</ApplicationIcon>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<Compile Update="Properties\Resources.Designer.cs">
24+
<AutoGen>True</AutoGen>
25+
<DesignTime>True</DesignTime>
26+
<DependentUpon>Resources.resx</DependentUpon>
27+
</Compile>
28+
</ItemGroup>
29+
<ItemGroup>
30+
<None Update="app.vrmanifest">
31+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
32+
</None>
33+
<None Update="start\demo_start.cmd">
34+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
35+
</None>
36+
<None Update="stop\demo_stop.cmd">
37+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
38+
</None>
39+
</ItemGroup>
40+
<ItemGroup>
41+
<None Update="examples\restart_voicemeeter_audio_engine.cmd">
42+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
43+
</None>
44+
</ItemGroup>
45+
<ItemGroup>
46+
<EmbeddedResource Update="Properties\Resources.resx">
47+
<Generator>ResXFileCodeGenerator</Generator>
48+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
49+
</EmbeddedResource>
50+
</ItemGroup>
51+
<ItemGroup>
52+
<Content Include="resources\logo.ico" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ProjectReference Include="..\EasyOpenVR\EasyOpenVR.csproj" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
59+
</ItemGroup>
11760
</Project>

OpenVRStartup/Properties/Resources.Designer.cs

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenVRStartup/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@
125125
<value>..\resources\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126126
</data>
127127
<data name="Version" xml:space="preserve">
128-
<value>v0.13</value>
128+
<value>v2.0.0</value>
129129
</data>
130130
</root>

OpenVRStartup/Utils.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
using System;
2+
using System.Runtime.InteropServices;
23

34
namespace OpenVRStartup
45
{
5-
static class Utils
6+
internal static class Utils
67
{
7-
public static void PrintColor(String text, ConsoleColor color = ConsoleColor.White)
8+
public static void PrintColor(string text, ConsoleColor color = ConsoleColor.White)
89
{
910
Console.ForegroundColor = color;
1011
Console.WriteLine(text);
1112
Console.ForegroundColor = ConsoleColor.White;
1213
}
1314

14-
public static void Print(String text)
15+
public static void Print(string text)
1516
{
1617
PrintColor(text, ConsoleColor.White);
1718
}
18-
public static void PrintVerbose(String text)
19+
20+
public static void PrintVerbose(string text)
1921
{
2022
PrintColor(text, ConsoleColor.Gray);
2123
}
22-
public static void PrintDebug(String text)
24+
25+
public static void PrintDebug(string text)
2326
{
2427
PrintColor(text, ConsoleColor.Cyan);
2528
}
26-
public static void PrintInfo(String text)
29+
30+
public static void PrintInfo(string text)
2731
{
2832
PrintColor(text, ConsoleColor.Green);
2933
}
30-
public static void PrintWarning(String text)
34+
35+
public static void PrintWarning(string text)
3136
{
3237
PrintColor(text, ConsoleColor.Yellow);
3338
}
34-
public static void PrintError(String text)
39+
40+
public static void PrintError(string text)
3541
{
3642
PrintColor(text, ConsoleColor.Red);
3743
}
3844

3945
public static uint SizeOf(object o)
4046
{
41-
return (uint)System.Runtime.InteropServices.Marshal.SizeOf(o);
47+
return (uint)Marshal.SizeOf(o);
4248
}
4349
}
44-
}
50+
}

0 commit comments

Comments
 (0)