本文整理汇总了C++中OvrGuiSys类的典型用法代码示例。如果您正苦于以下问题:C++ OvrGuiSys类的具体用法?C++ OvrGuiSys怎么用?C++ OvrGuiSys使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OvrGuiSys类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEvent_Impl
//==============================
// ResumeMovieComponent::OnEvent_Impl
eMsgStatus ResumeMovieComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
switch( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return Frame( guiSys, vrFrame, self, event );
case VRMENU_EVENT_FOCUS_GAINED:
return FocusGained( guiSys, vrFrame, self, event );
case VRMENU_EVENT_FOCUS_LOST:
return FocusLost( guiSys, vrFrame, self, event );
case VRMENU_EVENT_TOUCH_DOWN:
if ( CallbackView != NULL )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
return MSG_STATUS_CONSUMED;
}
return MSG_STATUS_ALIVE;
case VRMENU_EVENT_TOUCH_UP:
if ( !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) && ( CallbackView != NULL ) )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->ResumeChoice( ItemNum );
return MSG_STATUS_CONSUMED;
}
return MSG_STATUS_ALIVE;
default:
OVR_ASSERT( !"Event flags mismatch!" );
return MSG_STATUS_ALIVE;
}
}
示例2: OnOpening
eMsgStatus OnOpening( OvrGuiSys & guiSys, ovrFrameInput const & vrFrame, VRMenuObject * self, VRMenuEvent const & event )
{
OVR_UNUSED( vrFrame );
OVR_UNUSED( event );
Oculus360Videos * videos = static_cast< Oculus360Videos* >( guiSys.GetApp()->GetAppInterface() );
CurrentVideo = (OvrVideosMetaDatum *)( videos->GetActiveVideo() );
// If opening VideoMenu without a Video selected, bail
if ( CurrentVideo == NULL )
{
guiSys.CloseMenu( &VideoMenu, false );
}
LoadAttribution( self );
return MSG_STATUS_CONSUMED;
}
示例3: DispatchToPath
//==============================
// VRMenuEventHandler::DispatchToPath
bool VRMenuEventHandler::DispatchToPath( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuEvent const & event, Array< menuHandle_t > const & path, bool const log ) const
{
// send to the focus path only -- this list should be parent -> child order
for ( int i = 0; i < path.GetSizeI(); ++i )
{
VRMenuObject * obj = guiSys.GetVRMenuMgr().ToObject( path[i] );
char const * const indent = " ";
// set to
if ( obj != NULL && DispatchToComponents( guiSys, vrFrame, event, obj ) )
{
if ( log )
{
LOG( "%sDispatchToPath: %s, object '%s' consumed event.", &indent[64 - i * 2],
VRMenuEvent::EventTypeNames[event.EventType], ( obj != NULL ? obj->GetText().ToCStr() : "<null>" ) );
}
return true; // consumed by a component
}
if ( log )
{
LOG( "%sDispatchToPath: %s, object '%s' passed event.", &indent[64 - i * 2],
VRMenuEvent::EventTypeNames[event.EventType], obj != NULL ? obj->GetText().ToCStr() : "<null>" );
}
}
return false;
}
示例4: OnInit
//==============================
// OvrSliderComponent::OnInit
eMsgStatus OvrSliderComponent::OnInit( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
OVR_UNUSED( vrFrame );
OVR_UNUSED( event );
// find the starting offset of the caret
//LOG( "OvrSliderComponent - VRMENU_EVENT_INIT" );
VRMenuObject * caret = guiSys.GetVRMenuMgr().ToObject( self->ChildHandleForId( guiSys.GetVRMenuMgr(), ScrubberId ) );
if ( caret != NULL )
{
CaretBasePose = caret->GetLocalPose();
}
SetCaretPoseFromFrac( guiSys.GetVRMenuMgr(), self, SliderFrac );
UpdateText( guiSys.GetVRMenuMgr(), self, BubbleId );
return MSG_STATUS_ALIVE;
}
示例5: FindTargetPath
//==============================
// FindTargetPath
static void FindTargetPath( OvrGuiSys & guiSys,
menuHandle_t const curHandle, Array< menuHandle_t > & targetPath )
{
VRMenuObject * obj = guiSys.GetVRMenuMgr().ToObject( curHandle );
if ( obj != NULL )
{
FindTargetPath( guiSys, obj->GetParentHandle(), targetPath );
targetPath.PushBack( curHandle );
}
}
示例6: OnMediaNotFound
void VideoBrowser::OnMediaNotFound( OvrGuiSys & guiSys, String & title, String & imageFile, String & message )
{
Videos.GetLocale().GetString( "@string/app_name", "@string/app_name", title );
imageFile = "assets/sdcard.png";
Videos.GetLocale().GetString( "@string/media_not_found", "@string/media_not_found", message );
OVR::Array< OVR::String > wholeStrs;
wholeStrs.PushBack( "Gear VR" );
guiSys.GetDefaultFont().WordWrapText( message, 1.4f, wholeStrs );
}
示例7: PlaySoundEffect
//==============================
// ovrSoundLimiter::PlaySound
void ovrSoundLimiter::PlaySoundEffect( OvrGuiSys & guiSys, char const * soundName, double const limitSeconds )
{
double curTime = vrapi_GetTimeInSeconds();
double t = curTime - LastPlayTime;
//LOG_WITH_TAG( "VrMenu", "PlaySoundEffect( '%s', %.2f ) - t == %.2f : %s", soundName, limitSeconds, t, t >= limitSeconds ? "PLAYING" : "SKIPPING" );
if ( t >= limitSeconds )
{
guiSys.GetSoundEffectPlayer().Play( soundName );
LastPlayTime = curTime;
}
}
示例8: Frame
//==============================
// TheaterSelectionComponent::Frame
eMsgStatus TheaterSelectionComponent::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
double t = vrapi_GetTimeInSeconds();
if ( StartFadeInTime >= 0.0f && t >= StartFadeInTime )
{
HilightFader.StartFadeIn();
StartFadeInTime = -1.0f;
}
else if ( StartFadeOutTime >= 0.0f && t > StartFadeOutTime )
{
HilightFader.StartFadeOut();
StartFadeOutTime = -1.0f;
}
float const fadeRate = 1.0f / FadeDuration;
HilightFader.Update( fadeRate, vrFrame.DeltaSeconds );
float const hilightAlpha = HilightFader.GetFinalAlpha();
float const scale = ( ( HilightScale - 1.0f ) * hilightAlpha ) + 1.0f;
self->SetHilightScale( scale );
#if 0
if ( ( CallbackView != NULL ) && self->IsHilighted() && ( vrFrame.Input.buttonReleased & BUTTON_A ) )
{
if ( vrFrame.Input.buttonPressed & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
}
if ( vrFrame.Input.buttonReleased & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->SelectPressed();
}
}
#endif
return MSG_STATUS_ALIVE;
}
示例9: FocusGained
//==============================
// MovieSelectionComponent::FocusGained
eMsgStatus MovieSelectionComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
LOG( "FocusGained" );
// set the hilight flag
self->SetHilighted( true );
CallbackView->SelectionHighlighted( true );
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
return MSG_STATUS_ALIVE;
}
示例10: Frame
//==============================
// MovieSelectionComponent::Frame
eMsgStatus MovieSelectionComponent::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
CallbackView->SelectionHighlighted( self->IsHilighted() );
#if 0
if ( self->IsHilighted() )
{
if ( vrFrame.Input.buttonPressed & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
}
if ( vrFrame.Input.buttonReleased & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->SelectMovie();
}
}
#endif
return MSG_STATUS_ALIVE;
}
示例11: FocusGained
//==============================
// TheaterSelectionComponent::FocusGained
eMsgStatus TheaterSelectionComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
// set the hilight flag
self->SetHilighted( true );
StartFadeOutTime = -1.0;
StartFadeInTime = vrapi_GetTimeInSeconds();
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
return MSG_STATUS_ALIVE;
}
示例12: PlayMenuSound
void ovrSoundLimiter::PlayMenuSound( OvrGuiSys & guiSys, char const * appendKey, char const * soundName, double const limitSeconds )
{
char overrideSound[ 1024 ];
OVR_sprintf( overrideSound, 1024, "%s_%s", appendKey, soundName );
if ( guiSys.GetSoundEffectPlayer().Has( overrideSound ) )
{
PlaySoundEffect( guiSys, overrideSound, limitSeconds );
}
else
{
PlaySoundEffect( guiSys, soundName, limitSeconds );
}
}
示例13: OnFrameUpdate
//==============================
// OvrSliderComponent::OnFrameUpdate
eMsgStatus OvrSliderComponent::OnFrameUpdate( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
OVR_UNUSED( event );
if ( TouchDown )
{
UpdateText( guiSys.GetVRMenuMgr(), self, BubbleId );
UpdateText( guiSys.GetVRMenuMgr(), self, TextId );
}
if ( BubbleFadeOutTime > 0.0 )
{
if ( vrapi_GetTimeInSeconds() >= BubbleFadeOutTime )
{
BubbleFadeOutTime = -1.0;
BubbleFader.StartFadeOut();
}
}
VRMenuObject * bubble = guiSys.GetVRMenuMgr().ToObject( self->ChildHandleForId( guiSys.GetVRMenuMgr(), BubbleId ) );
if ( bubble != NULL )
{
float const fadeTime = 0.5f;
float const fadeRate = 1.0 / fadeTime;
BubbleFader.Update( fadeRate, vrFrame.DeltaSeconds );
Vector4f color = bubble->GetColor();
color.w = BubbleFader.GetFinalAlpha();
bubble->SetColor( color );
Vector4f textColor = bubble->GetTextColor();
textColor.w = color.w;
bubble->SetTextColor( textColor );
}
return MSG_STATUS_ALIVE;
}
示例14: FocusGained
//==============================
// ResumeMovieComponent::FocusGained
eMsgStatus ResumeMovieComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
//LOG( "FocusGained" );
HasFocus = true;
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
self->SetHilighted( true );
self->SetTextColor( HighlightColor );
if ( Icon != NULL )
{
Icon->SetColor( HighlightColor );
}
return MSG_STATUS_ALIVE;
}
示例15: FocusLost
//==============================
// ResumeMovieComponent::FocusLost
eMsgStatus ResumeMovieComponent::FocusLost( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
//LOG( "FocusLost" );
HasFocus = false;
Sound.PlaySound( guiSys.GetApp(), "gaze_off", 0.1 );
self->SetHilighted( false );
self->SetTextColor( self->IsHilighted() ? HighlightColor : NormalColor );
if ( Icon != NULL )
{
Icon->SetColor( self->IsHilighted() ? HighlightColor : NormalColor );
}
return MSG_STATUS_ALIVE;
}