Skip to content

Commit

Permalink
Add OpenVR bindings. Close LWJGL#160
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Jan 12, 2017
1 parent dfbfb7e commit 3fb2e0b
Show file tree
Hide file tree
Showing 31 changed files with 6,834 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ enum Artifacts {
"A royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles.",
Platforms.ALL
),
OPENVR(
"lwjgl-openvr", "LWJGL - OpenVR bindings",
"OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.",
Platforms.ALL
),
OVR(
"lwjgl-ovr", "LWJGL - OVR bindings",
"The API of the Oculus SDK.",
Expand Down
6 changes: 6 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
<src path="${src.templates.kotlin}/org/lwjgl/opengl/GLXTypes.kt" if:true="${opengl_types}"/>
<src path="${src.templates.kotlin}/org/lwjgl/opengl/WGLTypes.kt" if:true="${opengl_types}"/>
<src path="${src.templates.kotlin}/org/lwjgl/opengles" if:true="${binding.opengles}"/>
<src path="${src.templates.kotlin}/org/lwjgl/openvr" if:true="${binding.openvr}"/>
<src path="${src.templates.kotlin}/org/lwjgl/ovr" if:true="${binding.ovr}"/>
<src path="${src.templates.kotlin}/org/lwjgl/stb" if:true="${binding.stb}"/>
<src path="${src.templates.kotlin}/org/lwjgl/vulkan" if:true="${binding.vulkan}"/>
Expand Down Expand Up @@ -313,6 +314,7 @@
<exclude name="org/lwjgl/assimp/**" unless:true="${binding.assimp}"/>
<exclude name="org/lwjgl/bgfx/**" unless:true="${binding.bgfx}"/>
<exclude name="org/lwjgl/nuklear/**" unless:true="${binding.nuklear}"/>
<exclude name="org/lwjgl/openvr/**" unless:true="${binding.openvr}"/>
<exclude name="org/lwjgl/ovr/**" unless:true="${binding.ovr}"/>
<exclude name="org/lwjgl/stb/**" unless:true="${binding.stb}"/>

Expand Down Expand Up @@ -501,6 +503,7 @@

<include name="org/lwjgl/demo/opengl/**" if:true="${binding.opengl}"/>

<include name="org/lwjgl/demo/openvr/**" if:true="${binding.openvr}"/>
<include name="org/lwjgl/demo/ovr/**" if:true="${binding.ovr}"/>
<include name="org/lwjgl/demo/stb/**" if:true="${stb}"/>

Expand Down Expand Up @@ -1002,6 +1005,9 @@
</sources>
</release-module>

<!-- OpenVR -->
<release-module package="org.lwjgl.openvr" name="openvr" native-library="lwjgl_openvr" title="OpenVR" license="openvr" if:true="${binding.openvr}"/>

<!-- LibOVR -->
<release-module package="org.lwjgl.ovr" name="ovr" title="LibOVR" license="oculus" if:true="${binding.ovr}">
<natives>
Expand Down
1 change: 1 addition & 0 deletions config/build-bindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This script is included in /config/build-definitions.xml.
<property name="binding.opencl" value="true"/>
<property name="binding.opengl" value="true"/>
<property name="binding.opengles" value="true"/>
<property name="binding.openvr" value="true"/>
<property name="binding.par" value="true"/>
<property name="binding.sse" value="true"/>
<property name="binding.stb" value="true"/>
Expand Down
9 changes: 9 additions & 0 deletions config/linux/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@
</source>
</build>

<!-- OpenVR -->
<build name="lwjgl_openvr" dest="${bin.native}/openvr" if:true="${binding.openvr}">
<source>
<arg value="-I${src.native.rel}/openvr"/>
<fileset dir="." includes="${src.generated.native}/openvr/*.c"/>
</source>
</build>

<!-- ParShapes -->
<build name="lwjgl_par" dest="${bin.native}/par" if:true="${binding.par}">
<source>
Expand Down Expand Up @@ -290,6 +298,7 @@
<update-dependency name="jemalloc" artifact="x64/libjemalloc.so" dest="${lib}" if:true="${binding.jemalloc}"/>
<update-dependency name="GLFW" artifact="x64/libglfw.so" dest="${lib}" if:true="${binding.glfw}"/>
<update-dependency name="OpenAL32" artifact="x64/libopenal.so" dest="${lib}" if:true="${binding.openal}"/>
<update-dependency name="OpenVR" artifact="x64/libopenvr_api.so" dest="${lib}" if:true="${binding.openvr}"/>

<chmod dir="${lib}" perm="755" includes="*.so"/>
</target>
Expand Down
11 changes: 10 additions & 1 deletion config/macosx/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@
</source>
</build>

<!-- OpenVR -->
<build name="lwjgl_openvr" dest="${bin.native}/openvr" if:true="${binding.openvr}">
<source>
<arg value="-I${src.native.rel}/openvr"/>
<fileset dir="." includes="${src.generated.native}/openvr/*.c"/>
</source>
</build>

<!-- ParShapes -->
<build name="lwjgl_par" dest="${bin.native}/par" if:true="${binding.par}">
<source>
Expand Down Expand Up @@ -290,7 +298,8 @@
<update-dependency name="jemalloc" artifact="x64/libjemalloc.dylib" dest="${lib}" if:true="${binding.jemalloc}"/>
<update-dependency name="GLFW" artifact="x64/libglfw.dylib" dest="${lib}" if:true="${binding.glfw}"/>
<update-dependency name="OpenAL32" artifact="x64/libopenal.dylib" dest="${lib}" if:true="${binding.openal}"/>
<update-dependency name="OpenVR" artifact="x64/libopenvr_api.dylib" dest="${lib}" if:true="${binding.openvr}"/>

<chmod dir="${lib}" perm="755" includes="*.dylib"/>
</target>
</project>
</project>
12 changes: 12 additions & 0 deletions config/windows/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ EXPORTS
</source>
</build>

<!-- OpenVR -->
<build name="lwjgl_openvr" dest="${bin.native}/openvr" if:true="${binding.openvr}">
<compileargs>
<arg value="/I${src.native}\openvr"/>
</compileargs>
<source>
<fileset dir="." includes="${src.generated.native}/openvr/*.c"/>
</source>
</build>

<!-- ParShapes -->
<build name="lwjgl_par" dest="${bin.native}/par" if:true="${binding.par}">
<compileargs>
Expand Down Expand Up @@ -344,6 +354,7 @@ EXPORTS
<update-dependency name="jemalloc (x86)" artifact="x86/jemalloc32.dll" dest="${lib}" if:true="${binding.jemalloc}"/>
<update-dependency name="GLFW (x86)" artifact="x86/glfw32.dll" dest="${lib}" if:true="${binding.glfw}"/>
<update-dependency name="OpenAL32 (x86)" artifact="x86/OpenAL32.dll" dest="${lib}" if:true="${binding.openal}"/>
<update-dependency name="OpenVR (x86)" artifact="x86/openvr_api32.dll" dest="${lib}" if:true="${binding.openvr}"/>
</target>

<target name="-update-dependencies-x64">
Expand All @@ -358,5 +369,6 @@ EXPORTS
<update-dependency name="jemalloc (x64)" artifact="x64/jemalloc.dll" dest="${lib}" if:true="${binding.jemalloc}"/>
<update-dependency name="GLFW (x64)" artifact="x64/glfw.dll" dest="${lib}" if:true="${binding.glfw}"/>
<update-dependency name="OpenAL32 (x64)" artifact="x64/OpenAL.dll" dest="${lib}" if:true="${binding.openal}"/>
<update-dependency name="OpenVR (x64)" artifact="x64/openvr_api.dll" dest="${lib}" if:true="${binding.openvr}"/>
</target>
</project>
27 changes: 27 additions & 0 deletions doc/3rdparty/openvr_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2015, Valve Corporation
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions doc/notes/3.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This build includes the following changes:

#### Bindings

- Added [OpenVR](https://github.com/ValveSoftware/openvr) bindings.
- Added [Tiny OpenEXR](https://github.com/syoyo/tinyexr) bindings.
- Added [Yoga](https://facebook.github.io/yoga/) bindings.
- nuklear: Update to 1.21 (up from 1.191)
Expand Down
Loading

0 comments on commit 3fb2e0b

Please sign in to comment.