Skip to content

Commit

Permalink
fix: PhoneVR for new ALVR C API (v22) (#306)
Browse files Browse the repository at this point in the history
* move json submodule to common/libs

* Update for new API Changes in ALVR v22

* Update PhoneVR.vcxproj

* lint fix

* lint fixes

* submodule is tagged to recent master branch of ALVR

- Will not release this way but have to do for testing
  • Loading branch information
ShootingKing-AM authored Mar 31, 2024
1 parent 70fcdee commit 4a5906c
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AllowShortIfStatementsOnASingleLine: false
AlignTrailingComments: true
SpacesBeforeTrailingComments: 3
# change the next line to All for Alistair's textbook style
AlwaysBreakAfterReturnType: TopLevelDefinitions
# AlwaysBreakAfterReturnType: TopLevelDefinitions
# #define SHORT_NAME 42
# #define LONGER_NAME 0x007f # does nice spacing for macros
AlignConsecutiveMacros: Consecutive
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = code/mobile/android/PhoneVR/ALVR
url = https://github.com/PhoneVR-Developers/ALVR-phonevr
[submodule "code/windows/libs/json"]
path = code/windows/libs/json
path = code/common/libs/json
url = https://github.com/nlohmann/json
[submodule "code/common/libs/eigen"]
path = code/common/libs/eigen
Expand Down
2 changes: 1 addition & 1 deletion code/mobile/android/PhoneVR/ALVR
Submodule ALVR updated 104 files
2 changes: 2 additions & 0 deletions code/mobile/android/PhoneVR/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
# find all src files
file(GLOB_RECURSE MY_SRC
../../../../common/libs/ifaddrs/*.c
../../../../common/libs/json/single_include/*.hpp
../../../../common/src/*.cpp
../../../mobile-common/*.cpp
)
Expand All @@ -31,6 +32,7 @@ target_include_directories(native-lib
PUBLIC ../../../../common/libs/asio/asio/include
PUBLIC ../../../../common/libs/eigen/Eigen
PUBLIC ../../../../common/libs/ifaddrs
PUBLIC ../../../../common/libs/json/single_include/

# my headers
PUBLIC ../../../../common/src
Expand Down
432 changes: 248 additions & 184 deletions code/mobile/android/PhoneVR/app/src/main/cpp/alvr_main.cpp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions code/windows/PhoneVR/PhoneVR/PhoneVR.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<WarningLevel>Level1</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;WIN32;_DEBUG;_WINDOWS;_USRDLL;PHONEVR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\..\common\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -112,7 +112,7 @@
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;_DEBUG;_WINDOWS;_USRDLL;PHONEVR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;$(SolutionDir)\..\..\common\src\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\..\common\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;$(SolutionDir)\..\..\common\src\</AdditionalIncludeDirectories>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -135,7 +135,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;WIN32;NDEBUG;_WINDOWS;_USRDLL;PHONEVR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\..\common\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -157,7 +157,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;NDEBUG;_WINDOWS;_USRDLL;PHONEVR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)\$(ProjectName);$(SolutionDir)\..\..\common\src;$(SolutionDir)\..\..\common\libs\json\include\;$(SolutionDir)\..\libs\x264\include;$(SolutionDir)\..\..\common\libs\asio\asio\include\;$(SolutionDir)\..\..\common\libs\eigen\Eigen;$(SolutionDir)\..\..\common\src\Utils;</AdditionalIncludeDirectories>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
Expand Down
2 changes: 1 addition & 1 deletion code/windows/PhoneVR/PhoneVR/openvr_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ namespace vr {

#endif // _INCLUDE_VRTYPES_H

// vrannotation.h
// vrannotation.h
#ifdef API_GEN
#define VR_CLANG_ATTR(ATTR) __attribute__((annotate(ATTR)))
#else
Expand Down

0 comments on commit 4a5906c

Please sign in to comment.