本文整理汇总了C++中ovr::AppLocal类的典型用法代码示例。如果您正苦于以下问题:C++ AppLocal类的具体用法?C++ AppLocal怎么用?C++ AppLocal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppLocal类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Java_com_oculus_vrappframework_VrActivity_nativeGetPopupSurfaceTexture
jobject Java_com_oculus_vrappframework_VrActivity_nativeGetPopupSurfaceTexture( JNIEnv *jni, jclass clazz,
jlong appPtr )
{
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
LOG( "%p getPopUpSurfaceTexture: %i", (void *)appPtr, appLocal->GetDialogTexture()->GetTextureId() );
return appLocal->GetDialogTexture()->GetJavaObject();
}
示例2: Java_com_oculus_vrappframework_VrApp_nativeOnResume
void Java_com_oculus_vrappframework_VrApp_nativeOnResume( JNIEnv *jni, jclass clazz,
jlong appPtr )
{
LOG( "%p nativeResume", (void *)appPtr );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
appLocal->GetMessageQueue().SendPrintf( "resume " );
}
示例3: Java_com_oculus_vrappframework_VrActivity_nativePopup
void Java_com_oculus_vrappframework_VrActivity_nativePopup( JNIEnv *jni, jclass clazz,
jlong appPtr, jint width, jint height, jfloat seconds )
{
LOG( "%p nativePopup", (void *)appPtr );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
appLocal->GetMessageQueue().PostPrintf( "popup %i %i %f", width, height, seconds );
}
示例4: Java_com_oculus_vrappframework_VrActivity_nativeTouch
void Java_com_oculus_vrappframework_VrActivity_nativeTouch( JNIEnv *jni, jclass clazz,
jlong appPtr, jint action, jfloat x, jfloat y )
{
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
// Suspend input until EnteredVrMode( INTENT_LAUNCH ) has finished to avoid overflowing the message queue on long loads.
if ( appLocal->IntentType != OVR::INTENT_LAUNCH )
{
appLocal->GetMessageQueue().PostPrintfIfSpaceAvailable( MIN_SLOTS_AVAILABLE_FOR_INPUT, "touch %i %f %f", action, x, y );
}
}
示例5: Java_com_oculus_vrappframework_VrActivity_nativeJoypadAxis
void Java_com_oculus_vrappframework_VrActivity_nativeJoypadAxis( JNIEnv *jni, jclass clazz,
jlong appPtr, jfloat lx, jfloat ly, jfloat rx, jfloat ry )
{
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
// Suspend input until OneTimeInit() has finished to avoid overflowing the message queue on long loads.
if ( appLocal->OneTimeInitCalled )
{
appLocal->GetMessageQueue().PostPrintfIfSpaceAvailable( MIN_SLOTS_AVAILABLE_FOR_INPUT, "joy %f %f %f %f", lx, ly, rx, ry );
}
}
示例6: Java_com_oculus_vrappframework_VrActivity_nativeKeyEvent
void Java_com_oculus_vrappframework_VrActivity_nativeKeyEvent( JNIEnv *jni, jclass clazz,
jlong appPtr, jint key, jboolean down, jint repeatCount )
{
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
// Suspend input until OneTimeInit() has finished to avoid overflowing the message queue on long loads.
if ( appLocal->OneTimeInitCalled )
{
OVR::ovrKeyCode keyCode = OVR::OSKeyToKeyCode( key );
appLocal->GetMessageQueue().PostPrintfIfSpaceAvailable( MIN_SLOTS_AVAILABLE_FOR_INPUT, "key %i %i %i", keyCode, down, repeatCount );
}
}
示例7: Java_com_oculus_vrappframework_VrActivity_nativeKeyEvent
void Java_com_oculus_vrappframework_VrActivity_nativeKeyEvent( JNIEnv *jni, jclass clazz,
jlong appPtr, jint key, jboolean down, jint repeatCount )
{
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
// Suspend input until EnteredVrMode( INTENT_LAUNCH ) has finished to avoid overflowing the message queue on long loads.
if ( appLocal->IntentType != OVR::INTENT_LAUNCH )
{
OVR::ovrKeyCode keyCode = OVR::OSKeyToKeyCode( key );
//LOG( "nativeKeyEvent: key = %i, keyCode = %i, down = %s, repeatCount = %i", key, keyCode, down ? "true" : "false", repeatCount );
appLocal->GetMessageQueue().PostPrintfIfSpaceAvailable( MIN_SLOTS_AVAILABLE_FOR_INPUT, "key %i %i %i", keyCode, down, repeatCount );
}
}
示例8: Java_com_oculus_vrappframework_VrApp_nativeSurfaceDestroyed
void Java_com_oculus_vrappframework_VrApp_nativeSurfaceDestroyed( JNIEnv *jni, jclass clazz,
jlong appPtr, jobject surface )
{
LOG( "%p nativeSurfaceDestroyed()", (void *)appPtr );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
appLocal->GetMessageQueue().SendPrintf( "surfaceDestroyed " );
LOG( " ANativeWindow_release( %p )", appLocal->pendingNativeWindow );
ANativeWindow_release( appLocal->pendingNativeWindow );
appLocal->pendingNativeWindow = NULL;
}
示例9: Java_com_oculus_vrappframework_VrActivity_nativeNewIntent
void Java_com_oculus_vrappframework_VrActivity_nativeNewIntent( JNIEnv *jni, jclass clazz,
jlong appPtr, jstring fromPackageName, jstring command, jstring uriString )
{
LOG( "%p nativeNewIntent", (void *)appPtr );
JavaUTFChars utfPackageName( jni, fromPackageName );
JavaUTFChars utfUri( jni, uriString );
JavaUTFChars utfJson( jni, command );
char intentMessage[4096];
ComposeIntentMessage( utfPackageName.ToStr(), utfUri.ToStr(), utfJson.ToStr(),
intentMessage, sizeof( intentMessage ) );
LOG( "nativeNewIntent: %s", intentMessage );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
appLocal->GetMessageQueue().PostString( intentMessage );
}
示例10: Java_com_oculus_vrappframework_VrApp_nativeSurfaceCreated
void Java_com_oculus_vrappframework_VrApp_nativeSurfaceCreated( JNIEnv *jni, jclass clazz,
jlong appPtr, jobject surface )
{
LOG( "%p nativeSurfaceCreated( %p )", (void *)appPtr, surface );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
ANativeWindow * newNativeWindow = ANativeWindow_fromSurface( jni, surface );
if ( ANativeWindow_getWidth( newNativeWindow ) < ANativeWindow_getHeight( newNativeWindow ) )
{
// An app that is relaunched after pressing the home button gets an initial surface with
// the wrong orientation even though android:screenOrientation="landscape" is set in the
// manifest. The choreographer callback will also never be called for this surface because
// the surface is immediately replaced with a new surface with the correct orientation.
WARN( " Surface not in landscape mode!" );
}
LOG( " pendingNativeWindow = ANativeWindow_fromSurface( jni, surface )" );
appLocal->pendingNativeWindow = newNativeWindow;
appLocal->GetMessageQueue().SendPrintf( "surfaceCreated " );
}
示例11: Java_com_oculus_vrappframework_VrApp_nativeOnDestroy
void Java_com_oculus_vrappframework_VrApp_nativeOnDestroy( JNIEnv *jni, jclass clazz,
jlong appPtr )
{
LOG( "%p nativeDestroy", (void *)appPtr );
OVR::AppLocal * appLocal = (OVR::AppLocal *)appPtr;
const bool exitOnDestroy = appLocal->ExitOnDestroy;
appLocal->StopVrThread();
appLocal->SetActivity( jni, NULL );
delete appLocal;
vrapi_Shutdown();
if ( exitOnDestroy )
{
LOG( "ExitOnDestroy is true, exiting" );
exit( 0 ); // FIXME: is this still needed?
}
else
{
LOG( "ExitOnDestroy was false, returning normally." );
}
}