File: oculusvr-ovr-CustomJavaCode.java

package info (click to toggle)
libjogl2-java 2.3.2%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 44,112 kB
  • sloc: java: 218,529; ansic: 75,727; xml: 6,722; objc: 3,139; sh: 2,736; cpp: 139; awk: 46; makefile: 29
file content (33 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

    static final DynamicLibraryBundle dynamicLookupHelper;

    static {
        dynamicLookupHelper = 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()) {
                          System.err.println("Couldn't load native OVR/JNI glue library");
                          return null;
                        } */
                        if(!bundle.isLibComplete()) {
                          System.err.println("Couldn't load native OVR/JNI glue library");
                          return null;
                        }
                        if( !initializeImpl() ) {
                          System.err.println("Native initialization failure of OVR/JNI glue library");
                          return null;
                        }
                        return bundle;
                    } } );
    }

    /**
     * Accessor.
     * @returns true if OVR library is available on this machine.
     */
    public static boolean isAvailable() { return dynamicLookupHelper != null; }