Skip to content

Commit

Permalink
Merge pull request #117 from BastiaanOlij/update_upstream_20210515
Browse files Browse the repository at this point in the history
Update to godot-cpp for Godot 3.3, OpenVR 1.16.8 and add new functions
  • Loading branch information
BastiaanOlij committed Jun 21, 2021
2 parents 63832c4 + 61329d6 commit fe75f98
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 29 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
platform: linux
- os: windows-latest
platform: windows
- os: macOS-latest
platform: osx
# - os: macOS-latest
# platform: osx

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -41,10 +41,10 @@ jobs:
pip install scons
if: matrix.os == 'windows-latest'

- name: Install scons (macOS)
run: |
brew install scons
if: matrix.os == 'macos-latest'
# - name: Install scons (macOS)
# run: |
# brew install scons
# if: matrix.os == 'macos-latest'

- name: Run the build for godot-cpp
run: |
Expand Down Expand Up @@ -79,14 +79,14 @@ jobs:
openvr/bin/linux64/libopenvr_api.so
if: matrix.os == 'ubuntu-18.04'

- name: Upload build files (artifacts) (macOS)
uses: actions/upload-artifact@v2
with:
name: build-files-macos
path: |
demo/addons/godot-openvr/bin/osx/libgodot_openvr.dylib
openvr/bin/osx64/OpenVR.framework
if: matrix.os == 'macos-latest'
# - name: Upload build files (artifacts) (macOS)
# uses: actions/upload-artifact@v2
# with:
# name: build-files-macos
# path: |
# demo/addons/godot-openvr/bin/osx/libgodot_openvr.dylib
# openvr/bin/osx32/OpenVR.framework
# if: matrix.os == 'macos-latest'

- name: Upload build files (artifacts) (Windows)
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -123,8 +123,8 @@ jobs:
cp -r godot_openvr/demo/addons/godot-openvr addons/godot-openvr
cp build-files-linux/demo/addons/godot-openvr/bin/x11/libgodot_openvr.so addons/godot-openvr/bin/x11/libgodot_openvr.so
cp build-files-linux/openvr/bin/linux64/libopenvr_api.so addons/godot-openvr/bin/x11/libopenvr_api.so
cp build-files-macos/demo/addons/godot-openvr/bin/osx/libgodot_openvr.dylib addons/godot-openvr/bin/osx/libgodot_openvr.dylib
cp -r build-files-macos/openvr/bin/osx64/OpenVR.framework addons/godot-openvr/bin/osx/OpenVR.framework
# cp build-files-macos/demo/addons/godot-openvr/bin/osx/libgodot_openvr.dylib addons/godot-openvr/bin/osx/libgodot_openvr.dylib
# cp -r build-files-macos/openvr/bin/osx32/OpenVR.framework addons/godot-openvr/bin/osx/OpenVR.framework
cp build-files-windows/demo/addons/godot-openvr/bin/win64/libgodot_openvr.dll addons/godot-openvr/bin/win64/libgodot_openvr.dll
cp build-files-windows/openvr/bin/win64/openvr_api.dll addons/godot-openvr/bin/win64/openvr_api.dll
- name: Calculate GIT short ref
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-d

Mac notes
---------
Mac is currently untested, I unfortunately do not have the required hardware. If anyone wants to hold up their hands, please contact me :)
Valve has dropped support for MacOS in the latest version of OpenVR/SteamVR. While a 32bit binary is still included we have not been able to get this to work.
If you have a Mac and are willing to investigate this issue we would welcome a PR with the required fixes but otherwise support of MacOS has been dropped.

Linux notes
-----------
Expand Down
13 changes: 5 additions & 8 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'no'))
opts.Add(EnumVariable('bits', "CPU architecture", '64', ['32', '64']))

# Other needed paths
godot_headers_path = "godot-cpp/godot_headers/"
godot_headers_path = "godot-cpp/godot-headers/"
godot_cpp_path = "godot-cpp/"
godot_cpp_library = "libgodot-cpp"

Expand All @@ -43,7 +43,7 @@ platform_dir = ''
if env['platform'] == 'windows':
env['target_path'] += 'win' + env['bits'] + '/'
godot_cpp_library += '.windows'
platform_dir = 'win'
platform_dir = 'win' + str(env['bits'])
if not env['use_llvm']:
# This makes sure to keep the session environment variables on windows,
# that way you can run scons in a vs 2017 prompt and it will find all the required tools
Expand All @@ -66,7 +66,7 @@ if env['platform'] == 'windows':
elif env['platform'] == 'osx':
env['target_path'] += 'osx/'
godot_cpp_library += '.osx'
platform_dir = 'osx'
platform_dir = 'osx32' # on OSX this is a universal binary
if env['target'] in ('debug', 'd'):
env.Append(CCFLAGS = ['-g','-O2', '-arch', 'x86_64'])
else:
Expand All @@ -77,7 +77,7 @@ elif env['platform'] == 'osx':
elif env['platform'] in ('x11', 'linux'):
env['target_path'] += 'x11/'
godot_cpp_library += '.linux'
platform_dir = 'linux'
platform_dir = 'linux' + str(env['bits'])
if env['target'] in ('debug', 'd'):
env.Append(CCFLAGS = ['-fPIC', '-g3','-Og', '-std=c++17'])
else:
Expand Down Expand Up @@ -108,14 +108,11 @@ env.Append(CPPPATH=[
env.Append(LIBPATH=[godot_cpp_path + 'bin/'])
env.Append(LIBS=[godot_cpp_library])

# Add our openvr library
platform_dir += str(env['bits'])

if (os.name == "nt" and os.getenv("VCINSTALLDIR")):
env.Append(LIBPATH=[env['openvr_path'] + 'lib/' + platform_dir])
env.Append(LINKFLAGS=['openvr_api.lib'])
elif env['platform'] == "osx":
env.Append(LINKFLAGS = ['-F' + env['openvr_path'] + 'bin/osx64', '-framework', 'OpenVR'])
env.Append(LINKFLAGS = ['-F' + env['openvr_path'] + 'bin/osx32', '-framework', 'OpenVR'])
else:
env.Append(LIBPATH=[env['openvr_path'] + 'lib/' + platform_dir])
env.Append(LIBS=['openvr_api'])
Expand Down
3 changes: 2 additions & 1 deletion demo/addons/godot-openvr/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ More frequent updates may be available on the source repository.

1.1.0 - In progress
-------------------
- Build for Godot 3.2
- Build for Godot 3.3
- Now using OpenVR 1.16.8 (drops MacOS support)
- Added support for actions
- Added support for request play area
- Added skeleton support (finger tracking)
Expand Down
Binary file modified demo/addons/godot-openvr/bin/win64/libgodot_openvr.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion godot-cpp
2 changes: 1 addition & 1 deletion openvr
Submodule openvr updated 112 files
20 changes: 19 additions & 1 deletion src/ARVRInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,21 @@ void godot_arvr_notification(void *p_data, int p_what) {
// nothing to do here for now but we should implement this.
}

////////////////////////////////////////////////////////////////
// Return the camera feed that should be used for our background
// when we're dealing with AR.
int godot_arvr_get_camera_feed_id(void *) {

return 0;
}

////////////////////////////////////////////////////////////////
// Return a texture ID for the eye if we manage the depth buffer
int godot_arvr_get_external_depth_for_eye(void *p_data, int p_eye) {

return 0;
}

////////////////////////////////////////////////////////////////
// Structure to provide pointers to our interface functions.
const godot_arvr_interface_gdnative interface_struct = {
Expand All @@ -350,5 +365,8 @@ const godot_arvr_interface_gdnative interface_struct = {
godot_arvr_process,
// only available in Godot 3.2+
godot_arvr_get_external_texture_for_eye,
godot_arvr_notification
godot_arvr_notification,
godot_arvr_get_camera_feed_id,
// only available in Godot 3.3+
godot_arvr_get_external_depth_for_eye
};

0 comments on commit fe75f98

Please sign in to comment.