Skip to content

Commit

Permalink
Merge pull request #299 from thomasflynn/ovr_100
Browse files Browse the repository at this point in the history
Upgrade to Oculus SDK 1.0.0.0 (#294)
  • Loading branch information
thomasflynn committed Nov 7, 2015
2 parents 5a01f14 + ac2f405 commit 22e567c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
10 changes: 6 additions & 4 deletions GVRf/Framework/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)

ifndef OVR_MOBILE_SDK
OVR_MOBILE_SDK=../../ovr_mobile_sdk
OVR_MOBILE_SDK=../../ovr_sdk_mobile
endif

#include $(OVR_MOBILE_SDK)/VRLib/import_vrlib.mk
Expand Down Expand Up @@ -111,9 +111,10 @@ LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%)
#LOCAL_STATIC_LIBRARIES += staticAssimp
LOCAL_SHARED_LIBRARIES += assimp
LOCAL_SHARED_LIBRARIES += vrapi
LOCAL_STATIC_LIBRARIES += systemutils
LOCAL_STATIC_LIBRARIES += vrmodel
LOCAL_STATIC_LIBRARIES += vrappframework
LOCAL_STATIC_LIBRARIES += libovr
LOCAL_STATIC_LIBRARIES += libvrmodel
LOCAL_STATIC_LIBRARIES += libovrkernel

LOCAL_ARM_NEON := true

Expand All @@ -134,4 +135,5 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module,LibOVRKernel/Projects/AndroidPrebuilt/jni)
$(call import-module,VrApi/Projects/AndroidPrebuilt/jni)
$(call import-module,VrAppFramework/Projects/AndroidPrebuilt/jni)
$(call import-module,VrAppSupport/VrModel/Projects/Android/jni)
$(call import-module,VrAppSupport/SystemUtils/Projects/AndroidPrebuilt/jni)
$(call import-module,VrAppSupport/VrModel/Projects/AndroidPrebuilt/jni)
2 changes: 1 addition & 1 deletion GVRf/Framework/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ APP_PLATFORM := android-19
APP_STL := gnustl_static
NDK_TOOLCHAIN_VERSION := 4.8
ifndef OVR_MOBILE_SDK
OVR_MOBILE_SDK=../../ovr_mobile_sdk
OVR_MOBILE_SDK=../../ovr_sdk_mobile
endif

NDK_MODULE_PATH := $(OVR_MOBILE_SDK)
16 changes: 8 additions & 8 deletions GVRf/Framework/jni/oculus/activity_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ template <class PredictionTrait> jclass GVRActivityT<PredictionTrait>::GetGlobal
template <class R> void GVRActivityT<R>::Configure(OVR::ovrSettings & settings)
{
//General settings.
JNIEnv *env = app->GetVrJni();
JNIEnv *env = app->GetJava()->Env;
jobject vrSettings = env->CallObjectMethod(app->GetJava()->ActivityObject,
getAppSettingsMethodId);
jint framebufferPixelsWide = env->GetIntField(vrSettings,
env->GetFieldID(vrAppSettingsClass, "framebufferPixelsWide", "I"));
if (framebufferPixelsWide == -1) {
app->GetVrJni()->SetIntField(vrSettings,
app->GetJava()->Env->SetIntField(vrSettings,
env->GetFieldID(vrAppSettingsClass, "framebufferPixelsWide",
"I"), settings.FramebufferPixelsWide);
} else {
Expand Down Expand Up @@ -354,12 +354,12 @@ template <class R> void GVRActivityT<R>::Configure(OVR::ovrSettings & settings)

template <class R> void GVRActivityT<R>::OneTimeInit(const char * fromPackage, const char * launchIntentJSON, const char * launchIntentURI)
{
app->GetVrJni()->CallVoidMethod(app->GetJava()->ActivityObject, oneTimeInitMethodId );
app->GetJava()->Env->CallVoidMethod(app->GetJava()->ActivityObject, oneTimeInitMethodId );
}

template <class R> void GVRActivityT<R>::OneTimeShutdown()
{
app->GetVrJni()->CallVoidMethod(app->GetJava()->ActivityObject, oneTimeShutdownMethodId);
app->GetJava()->Env->CallVoidMethod(app->GetJava()->ActivityObject, oneTimeShutdownMethodId);

// Free GL resources
}
Expand Down Expand Up @@ -389,7 +389,7 @@ template <class R> OVR::Matrix4f GVRActivityT<R>::DrawEyeView(const int eye, con
glm::quat headRotation = headRotationProvider_.getPrediction(*this, frameParms, (1 == eye ? 4.0f : 3.5f) / 60.0f);
cameraRig_->getHeadTransform()->set_rotation(headRotation);

JNIEnv* jni = app->GetVrJni();
JNIEnv* jni = app->GetJava()->Env;
jni->CallVoidMethod(app->GetJava()->ActivityObject, drawEyeViewMethodId, eye, fovDegreesY);

if (eye == 1) {
Expand All @@ -412,7 +412,7 @@ template <class R> OVR::Matrix4f GVRActivityT<R>::DrawEyeView(const int eye, con

template <class R> OVR::Matrix4f GVRActivityT<R>::Frame( const OVR::VrFrame & vrFrame )
{
JNIEnv* jni = app->GetVrJni();
JNIEnv* jni = app->GetJava()->Env;
jni->CallVoidMethod(app->GetJava()->ActivityObject, beforeDrawEyesMethodId);
jni->CallVoidMethod(app->GetJava()->ActivityObject, drawFrameMethodId);

Expand Down Expand Up @@ -446,7 +446,7 @@ template <class R> OVR::Matrix4f GVRActivityT<R>::Frame( const OVR::VrFrame & vr
template <class R> bool GVRActivityT<R>::OnKeyEvent(const int keyCode, const int repeatCode,
const OVR::KeyEventType eventType) {

bool handled = app->GetVrJni()->CallBooleanMethod(app->GetJava()->ActivityObject,
bool handled = app->GetJava()->Env->CallBooleanMethod(app->GetJava()->ActivityObject,
onKeyEventNativeMethodId, keyCode, (int)eventType);

// if not handled back key long press, show global menu
Expand All @@ -458,7 +458,7 @@ template <class R> bool GVRActivityT<R>::OnKeyEvent(const int keyCode, const int
}

template <class R> bool GVRActivityT<R>::updateSensoredScene() {
return app->GetVrJni()->CallBooleanMethod(app->GetJava()->ActivityObject, updateSensoredSceneMethodId);
return app->GetJava()->Env->CallBooleanMethod(app->GetJava()->ActivityObject, updateSensoredSceneMethodId);
}

template <class R> void GVRActivityT<R>::setCameraRig(jlong cameraRig) {
Expand Down

0 comments on commit 22e567c

Please sign in to comment.