aboutsummaryrefslogtreecommitdiffstats
path: root/make/config
diff options
context:
space:
mode:
Diffstat (limited to 'make/config')
-rw-r--r--make/config/oculusvr/oculusvr-common.cfg34
-rw-r--r--make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java22
-rw-r--r--make/config/oculusvr/oculusvr.c1
-rw-r--r--make/config/oculusvr/oculusvr.cfg16
4 files changed, 73 insertions, 0 deletions
diff --git a/make/config/oculusvr/oculusvr-common.cfg b/make/config/oculusvr/oculusvr-common.cfg
new file mode 100644
index 000000000..4baa35f0b
--- /dev/null
+++ b/make/config/oculusvr/oculusvr-common.cfg
@@ -0,0 +1,34 @@
+Package com.jogamp.oculusvr
+
+# Specify output directories
+HierarchicalNativeOutput false
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/oculusvr
+
+# Raise OVRException instead of RuntimeException in glue code
+RuntimeExceptionType OVRException
+
+# We also have to hack its return type for now because we can't make
+# just that void* opaque
+Opaque long ovrHmd
+
+#ReturnValueCapacity alcOpenDevice 0
+
+# Mappings for data types
+Opaque boolean ovrBool
+
+# Not implemented in SDK !?
+Ignore ovrHmd_ProcessLatencyTest
+
+# These routines use or return strings
+ReturnsString ovrHmd_GetLastError
+ReturnsString ovrHmd_GetLatencyTestResult
+ReturnsString ovrHmd_GetString
+
+ArgumentIsString ovrHmd_GetFloat 1
+ArgumentIsString ovrHmd_SetFloat 1
+ArgumentIsString ovrHmd_GetFloatArray 1
+ArgumentIsString ovrHmd_SetFloatArray 1
+ArgumentIsString ovrHmd_GetArraySize 1
+
+
diff --git a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java
new file mode 100644
index 000000000..06f7b3234
--- /dev/null
+++ b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java
@@ -0,0 +1,22 @@
+
+static {
+ AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
+ public DynamicLibraryBundle run() {
+ final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new OVRDynamicLibraryBundleInfo());
+ if(null==bundle) {
+ throw new RuntimeException("Null DynamicLibraryBundle");
+ }
+ /** No native tool library to load
+ if(!bundle.isToolLibLoaded()) {
+ throw new RuntimeException("Couln't load native OVR library");
+ } */
+ if(!bundle.isLibComplete()) {
+ throw new RuntimeException("Couln't load native OVR/JNI glue library");
+ }
+ if( !initializeImpl() ) {
+ throw new RuntimeException("Initialization failure");
+ }
+ return bundle;
+ } } );
+}
+
diff --git a/make/config/oculusvr/oculusvr.c b/make/config/oculusvr/oculusvr.c
new file mode 100644
index 000000000..6d850a380
--- /dev/null
+++ b/make/config/oculusvr/oculusvr.c
@@ -0,0 +1 @@
+#include "OVR_CAPI.h"
diff --git a/make/config/oculusvr/oculusvr.cfg b/make/config/oculusvr/oculusvr.cfg
new file mode 100644
index 000000000..aa439772b
--- /dev/null
+++ b/make/config/oculusvr/oculusvr.cfg
@@ -0,0 +1,16 @@
+# This .cfg file is used to generate the JOAL interface.
+Include oculusvr-common.cfg
+
+Style AllStatic
+JavaClass OVR
+
+Import com.jogamp.oculusvr.*
+Import java.security.AccessController
+Import java.security.PrivilegedAction
+
+IncludeAs CustomJavaCode OVR oculusvr-ovr-CustomJavaCode.java
+ManualStaticInitCall OVR
+
+# Provide #includes to native code
+CustomCCode #include <OVR_CAPI.h>
+