googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

gvr_create() crash : gvr ndk integrated with Ogre #264

Closed wangcan26 closed 7 years ago

wangcan26 commented 7 years ago

Recently i developed cross-platform vr for mobiles, i choose to integrate gvr sdk ( ndk version) with Ogre. I successfully integrate it with Ogre for android. I obtained by jni a gvr context from which a gvr_api obtained by ndk ,then i can get head_view and do head tracking.

When i integrate it for iOS I noted that a gvr_api can directly obtained by gvr_create() method.

In Ogre, i call gvr_create() in the applicationdidFinishLaunchingWithOptions method, which will run Ogre setup.

However, the app runs crash at gvr_create() call , the error reports as: libsystem_c.dylib`strlen:

    0x181ea5040 <+0>:  stp    x29, x30, [sp, #-16]!
    0x181ea5044 <+4>:  mov    x29, sp
    0x181ea5048 <+8>:  and    x1, x0, #0xfffffffffffffff0
->  0x181ea504c <+12>: ldr    q0, [x1]
    0x181ea5050 <+16>: adr    x3, #-208  

Why? what should i note for , when i want to integrate gvr sdk for iOS c/c++ applications?

sanjayc77 commented 7 years ago

Make sure you have an OpenGL context set before calling gvr_create().