elect
10/26/2016, 7:48 AMfun main(args: Array<String>) {
Native.register(NativeLibrary.getInstance("openvr_api"))
val error = IntByReference()
val hmd = VR_Init(error, EVRApplicationType.VRApplication_Scene.i)
}
but if I write:
class OpenVR {
companion object {
init { Native.register(NativeLibrary.getInstance("openvr_api")) }
}
}
fun main(args: Array<String>) {
val OpenVR = OpenVR()
val error = IntByReference()
val hmd = VR_Init(error, EVRApplicationType.VRApplication_Scene.i)
}
I get then
Exception in thread "main" java.lang.IllegalArgumentException: Can't determine class with native methods from the current context (class main.OpenVR)