Skip to content

Commit 747626c

Browse files
committed
Initial
0 parents  commit 747626c

File tree

8 files changed

+1060
-0
lines changed

8 files changed

+1060
-0
lines changed

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.RU.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[![Yummygum-Icon](https://user-images.githubusercontent.com/9499881/27683803-659dc988-5cd8-11e7-9c05-0b747e917666.png)](https://github.com/TrueOpenVR/TrueOpenVR-Core/blob/master/README.md) [![Yummygum-Icon](https://user-images.githubusercontent.com/9499881/27683795-5b0fbac6-5cd8-11e7-929c-057833e01fb1.png)](https://github.com/TrueOpenVR/TrueOpenVR-Core/blob/master/README.RU.md)
2+
# True Open VR
3+
True Open VR - True Open VR это очень простой API, который позволяет получить доступ ко всем аппаратным средствам VR, любых поставщиков, не требуя, чтобы приложения обладали конкретными знаниями оборудования, на которое они нацелены. Этот репозиторий является исходным кодом основной библиотеки, содержащей API.
4+
5+
- Для разработки приложений можно импортировать функции напрямую или через библиотеку, вы можете посмотреть [демонстрационные приложения](https://github.com/TrueOpenVR/TrueOpenVR-Samples).
6+
7+
- Для разработки плагинов для VR оборудования вы можете посмореть [демонстрационные плагины](https://github.com/TrueOpenVR/TrueOpenVR-Plugins).
8+
9+
- Пишите ваши предложение или запрос новой функциональности через "Issue" или почту.
10+
## Загрузка
11+
>Версия для Windows 7, 8.1, 10
12+
13+
**[Загрузить](https://github.com/TrueOpenVR/TrueOpenVR-Core/releases)**

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[![Yummygum-Icon](https://user-images.githubusercontent.com/9499881/27683803-659dc988-5cd8-11e7-9c05-0b747e917666.png)](https://github.com/TrueOpenVR/TrueOpenVR-Core/blob/master/README.md) [![Yummygum-Icon](https://user-images.githubusercontent.com/9499881/27683795-5b0fbac6-5cd8-11e7-929c-057833e01fb1.png)](https://github.com/TrueOpenVR/TrueOpenVR-Core/blob/master/README.RU.md)
2+
# True Open VR
3+
True Open VR - True Open VR is an very simple API that allows access to all VR hardware from any vendors without requiring that applications have specific knowledge of the hardware they are targeting. This repository is an source code of main library that contains the API.
4+
5+
- For developing applications directly import functions from the main library or using the framework, you can see [sample apps](https://github.com/TrueOpenVR/TrueOpenVR-Samples).
6+
7+
- For developing plugins for VR hardware, you can see [sample plugins](https://github.com/TrueOpenVR/TrueOpenVR-Plugins).
8+
9+
- Write your proposals or feature request through "Issue" or email.
10+
## Download
11+
>Version for Windows 7, 8.1, 10
12+
13+
**[Download](https://github.com/TrueOpenVR/TrueOpenVR-Core/releases)**

TOVR/TOVR.cfg

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
-$A8
2+
-$B-
3+
-$C+
4+
-$D+
5+
-$E-
6+
-$F-
7+
-$G+
8+
-$H+
9+
-$I+
10+
-$J-
11+
-$K-
12+
-$L+
13+
-$M-
14+
-$N+
15+
-$O+
16+
-$P+
17+
-$Q-
18+
-$R-
19+
-$S-
20+
-$T-
21+
-$U-
22+
-$V+
23+
-$W-
24+
-$X+
25+
-$YD
26+
-$Z1
27+
-cg
28+
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
29+
-H+
30+
-W+
31+
-M
32+
-$M16384,1048576
33+
-K$00400000
34+
-LE"c:\programs\borland\delphi7\Projects\Bpl"
35+
-LN"c:\programs\borland\delphi7\Projects\Bpl"
36+
-w-UNSAFE_TYPE
37+
-w-UNSAFE_CODE
38+
-w-UNSAFE_CAST

TOVR/TOVR.dof

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
[FileVersion]
2+
Version=7.0
3+
[Compiler]
4+
A=8
5+
B=0
6+
C=1
7+
D=1
8+
E=0
9+
F=0
10+
G=1
11+
H=1
12+
I=1
13+
J=0
14+
K=0
15+
L=1
16+
M=0
17+
N=1
18+
O=1
19+
P=1
20+
Q=0
21+
R=0
22+
S=0
23+
T=0
24+
U=0
25+
V=1
26+
W=0
27+
X=1
28+
Y=1
29+
Z=1
30+
ShowHints=1
31+
ShowWarnings=1
32+
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
33+
NamespacePrefix=
34+
SymbolDeprecated=1
35+
SymbolLibrary=1
36+
SymbolPlatform=1
37+
UnitLibrary=1
38+
UnitPlatform=1
39+
UnitDeprecated=1
40+
HResultCompat=1
41+
HidingMember=1
42+
HiddenVirtual=1
43+
Garbage=1
44+
BoundsError=1
45+
ZeroNilCompat=1
46+
StringConstTruncated=1
47+
ForLoopVarVarPar=1
48+
TypedConstVarPar=1
49+
AsgToTypedConst=1
50+
CaseLabelRange=1
51+
ForVariable=1
52+
ConstructingAbstract=1
53+
ComparisonFalse=1
54+
ComparisonTrue=1
55+
ComparingSignedUnsigned=1
56+
CombiningSignedUnsigned=1
57+
UnsupportedConstruct=1
58+
FileOpen=1
59+
FileOpenUnitSrc=1
60+
BadGlobalSymbol=1
61+
DuplicateConstructorDestructor=1
62+
InvalidDirective=1
63+
PackageNoLink=1
64+
PackageThreadVar=1
65+
ImplicitImport=1
66+
HPPEMITIgnored=1
67+
NoRetVal=1
68+
UseBeforeDef=1
69+
ForLoopVarUndef=1
70+
UnitNameMismatch=1
71+
NoCFGFileFound=1
72+
MessageDirective=1
73+
ImplicitVariants=1
74+
UnicodeToLocale=1
75+
LocaleToUnicode=1
76+
ImagebaseMultiple=1
77+
SuspiciousTypecast=1
78+
PrivatePropAccessor=1
79+
UnsafeType=0
80+
UnsafeCode=0
81+
UnsafeCast=0
82+
[Linker]
83+
MapFile=0
84+
OutputObjs=0
85+
ConsoleApp=1
86+
DebugInfo=0
87+
RemoteSymbols=0
88+
MinStackSize=16384
89+
MaxStackSize=1048576
90+
ImageBase=4194304
91+
ExeDescription=
92+
[Directories]
93+
OutputDir=
94+
UnitOutputDir=
95+
PackageDLLOutputDir=
96+
PackageDCPOutputDir=
97+
SearchPath=
98+
Packages=
99+
Conditionals=
100+
DebugSourceDirs=
101+
UsePackages=0
102+
[Parameters]
103+
RunParams=
104+
HostApplication=
105+
Launcher=
106+
UseLauncher=0
107+
DebugCWD=
108+
[Language]
109+
ActiveLang=
110+
ProjectLang=
111+
RootDir=
112+
[Version Info]
113+
IncludeVerInfo=0
114+
AutoIncBuild=0
115+
MajorVer=1
116+
MinorVer=0
117+
Release=0
118+
Build=0
119+
Debug=0
120+
PreRelease=0
121+
Special=0
122+
Private=0
123+
DLL=0
124+
Locale=1049
125+
CodePage=1251
126+
[Version Info Keys]
127+
CompanyName=
128+
FileDescription=
129+
FileVersion=1.0.0.0
130+
InternalName=
131+
LegalCopyright=
132+
LegalTrademarks=
133+
OriginalFilename=
134+
ProductName=
135+
ProductVersion=1.0.0.0
136+
Comments=

TOVR/TOVR.dpr

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
library TOVR;
2+
3+
uses
4+
SysUtils, Classes, Windows, IniFiles, Registry, Dialogs;
5+
6+
type
7+
//HMD
8+
PHMD = ^THMD;
9+
_HMDData = record
10+
X: double;
11+
Y: double;
12+
Z: double;
13+
Yaw: double;
14+
Pitch: double;
15+
Roll: double;
16+
end;
17+
HMD = _HMDData;
18+
THMD = HMD;
19+
20+
//VR Init
21+
PVRInfo = ^TVRInfo;
22+
_VRInfo = record
23+
ScreenIndex: integer;
24+
Scale: boolean;
25+
UserWidth: integer;
26+
UserHeight: integer;
27+
end;
28+
VRInfo = _VRInfo;
29+
TVRInfo = VRInfo;
30+
31+
//Controllers
32+
PControllers = ^TControllers;
33+
_Controllers = record
34+
X: double;
35+
Y: double;
36+
Z: double;
37+
Yaw: double;
38+
Pitch: double;
39+
Roll: double;
40+
Buttons: dword;
41+
Trigger: byte;
42+
ThumbX: smallint;
43+
ThumbY: smallint;
44+
end;
45+
Controllers = _Controllers;
46+
TControllers = Controllers;
47+
48+
var
49+
PluginPath: string;
50+
DllHandle: HMODULE;
51+
52+
PluginGetInfo: function(out myVRInfo: TVRInfo): DWORD; stdcall;
53+
PluginGetHMDData: function(out myHMD: THMD): DWORD; stdcall;
54+
PluginGetControllersData: function(out myController, myController2: TControllers): DWORD; stdcall;
55+
PluginSetControllerData: function (dwIndex: integer; MotorSpeed: dword): DWORD; stdcall;
56+
PluginSetCentering: function (dwIndex: integer): DWORD; stdcall;
57+
58+
{$R *.res}
59+
60+
procedure GetPluginPath;
61+
var
62+
Ini: TIniFile; Reg: TRegistry;
63+
begin
64+
Reg:=TRegistry.Create;
65+
Reg.RootKey:=HKEY_CURRENT_USER;
66+
if Reg.OpenKey('\Software\TrueOpenVR', false) = false then Exit;
67+
if FileExists(Reg.ReadString('Path') + 'TOVR.ini') = false then Exit;
68+
69+
Ini:=TIniFile.Create(Reg.ReadString('Path') + 'TOVR.ini');
70+
PluginPath:=Reg.ReadString('Path') + 'Plugins\' + Ini.ReadString('Plugin', 'Path', 'OpenTrackUDP.dll');
71+
Ini.Free;
72+
Reg.Free;
73+
end;
74+
75+
function GetInfo(out myVRInfo: TVRInfo): DWORD; stdcall;
76+
var
77+
Ini: TIniFile; Reg: TRegistry;
78+
begin
79+
if FileExists(PluginPath) then begin
80+
Reg:=TRegistry.Create;
81+
Reg.RootKey:=HKEY_CURRENT_USER;
82+
Result:=0;
83+
if Reg.OpenKey('\Software\TrueOpenVR', false) = false then Exit;
84+
if FileExists(Reg.ReadString('Path') + 'TOVR.ini') = false then Exit;
85+
86+
Ini:=TIniFile.Create(Reg.ReadString('Path') + 'TOVR.ini');
87+
MyVRInfo.ScreenIndex:=Ini.ReadInteger('VRInit', 'ScreenIndex', 0);
88+
myVRInfo.Scale:=Ini.ReadBool('VRInit', 'Scale', false);
89+
myVRInfo.UserWidth:=Ini.ReadInteger('VRInit', 'UserWidth', 1280);
90+
myVRInfo.UserHeight:=Ini.ReadInteger('VRInit', 'UserHeight', 720);
91+
PluginPath:=Reg.ReadString('Path') + 'Plugins\' + Ini.ReadString('Plugin', 'Path', 'OpenTrackUDP.dll');
92+
Ini.Free;
93+
Reg.Free;
94+
Result:=1;
95+
end else Result:=0;
96+
end;
97+
98+
function GetHMDData(out myHMD: THMD): DWORD; stdcall;
99+
var
100+
PluginHMD: THMD;
101+
begin
102+
if FileExists(PluginPath) = false then begin Result:=0; Exit; end;
103+
Result:=PluginGetHMDData(PluginHMD);
104+
if Result <> 0 then begin
105+
myHMD.X:=PluginHMD.X;
106+
myHMD.Y:=PluginHMD.Y;
107+
myHMD.Z:=PluginHMD.Z;
108+
myHMD.Yaw:=PluginHMD.Yaw;
109+
myHMD.Pitch:=PluginHMD.Pitch;
110+
myHMD.Roll:=PluginHMD.Roll;
111+
end;
112+
end;
113+
114+
function GetControllersData(out myController, myController2: TControllers): DWORD; stdcall;
115+
var
116+
PluginController, PluginController2: TControllers;
117+
begin
118+
if FileExists(PluginPath) = false then begin Result:=0; Exit; end;
119+
Result:=PluginGetControllersData(PluginController, PluginController2);
120+
if Result <> 0 then begin
121+
//Controller 1
122+
myController.X:=PluginController.X;
123+
myController.Y:=PluginController.Y;
124+
myController.Z:=PluginController.Z;
125+
126+
myController.Yaw:=PluginController.Yaw;
127+
myController.Pitch:=PluginController.Pitch;
128+
myController.Roll:=PluginController.Roll;
129+
130+
myController.Buttons:=PluginController.Buttons;
131+
myController.Trigger:=PluginController.Trigger;
132+
myController.ThumbX:=PluginController.ThumbX;
133+
myController.ThumbY:=PluginController.ThumbY;
134+
135+
//Controller 2
136+
myController2.X:=PluginController2.X;
137+
myController2.Y:=PluginController2.Y;
138+
myController2.Z:=PluginController2.Z;
139+
140+
myController2.Yaw:=PluginController2.Yaw;
141+
myController2.Pitch:=PluginController2.Pitch;
142+
myController2.Roll:=PluginController2.Roll;
143+
144+
myController2.Buttons:=PluginController2.Buttons;
145+
myController2.Trigger:=PluginController2.Trigger;
146+
myController2.ThumbX:=PluginController2.ThumbX;
147+
myController2.ThumbY:=PluginController2.ThumbY;
148+
end;
149+
end;
150+
151+
function SetControllerData(dwIndex: integer; MotorSpeed: dword): DWORD; stdcall;
152+
begin
153+
if FileExists(PluginPath) = false then begin Result:=0; Exit; end;
154+
Result:=PluginSetControllerData(dwIndex, MotorSpeed);
155+
end;
156+
157+
function SetCentering(dwIndex: integer): DWORD; stdcall;
158+
begin
159+
if FileExists(PluginPath) = false then begin Result:=0; Exit; end;
160+
Result:=PluginSetCentering(dwIndex);
161+
end;
162+
163+
exports
164+
GetInfo index 1, GetHMDData index 2, SetCentering index 3, GetControllersData index 4, SetControllerData index 5;
165+
166+
begin
167+
GetPluginPath;
168+
if FileExists(PluginPath) then begin
169+
DllHandle:=LoadLibrary(PChar(PluginPath));
170+
@PluginGetInfo:=GetProcAddress(DllHandle, 'GetInfo');
171+
@PluginGetHMDData:=GetProcAddress(DllHandle, 'GetHMDData');
172+
@PluginGetControllersData:=GetProcAddress(DllHandle, 'GetControllersData');
173+
@PluginSetControllerData:=GetProcAddress(DllHandle, 'SetControllerData');
174+
@PluginSetCentering:=GetProcAddress(DllHandle, 'SetCentering');
175+
end;
176+
end.
177+

TOVR/TOVR.res

876 Bytes
Binary file not shown.

TOVR/clear.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
del *.obj
2+
del *.dcu
3+
del *.~*
4+
del *.hpp
5+
del *.dcp
6+
del *.dpl
7+
del *.cesettings
8+
del *.bak
9+
--del *.exe*

0 commit comments

Comments
 (0)