Page 1 of 1

Animation not starting during launching via SDL

Posted: 30 Jul 2024, 15:53
by Arkadiy_Kolomiets
This code is run properly via the launcher but not via SDL

I have the animation
<Storyboard x:Key="UpDownStoryboard">
    <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
                     To="0" Duration="0:0:1"
                     From="-100"/>
</Storyboard>
</UserControl.Resources>
that is triggered by a bonded property that changes inside the view model
<Style TargetType="local:cMessageSectionView">
    <Style.Triggers>
        <DataTrigger Binding="{Binding DataContext.IsInitialAnimation, ElementName=AssistantScreen}" Value="True">
            <DataTrigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource UpDownStoryboard}"/>
            </DataTrigger.EnterActions>
        </DataTrigger>
    </Style.Triggers>
</Style>
Inside the SDL I have the buffers that helped me to solve a similar problem but with clipped objects, that moved outside from the clipped section
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);

Are there any limitations and features for using animation when running through SDL? Or what could be the reason that animation does not work?

Re: Animation not starting during launching via SDL

Posted: 31 Jul 2024, 18:35
by jsantos
Are there any limitations and features for using animation when running through SDL? Or what could be the reason that animation does not work?
Our core technology knows nothing about SDL, this is an integration issue. Are you sending the time correctly when updating the view (global time is needed, not deltas)

Re: Animation not starting during launching via SDL

Posted: 06 Aug 2024, 13:07
by Arkadiy_Kolomiets
I followed the integration rules as you suggested in this post
viewtopic.php?p=17296&hilit=Clip#p17296

but there adding of these buffers helped to solve the problem
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
I strictly follow your integration guide and I sending the time in this way

    double cNoesisScreenManager::getTickInMs() const {
        return static_cast<double>(as_sec(elapsed_time).count());
    }
    
    void cNoesisScreenManager::updateRenderTick(const std::chrono::duration<double> delta_time) {
        // Update tick
        const auto active_view = getCurrentScreen()->screen_view;
        elapsed_time += delta_time;
        active_view->Update(getTickInMs());
    }


But still animation didn't work

Re: Animation not starting during launching via SDL

Posted: 06 Aug 2024, 16:46
by jsantos
In your code, 'elapsed_time' is a delta or is it global?

Re: Animation not starting during launching via SDL

Posted: 06 Aug 2024, 17:17
by sfernandez
Also, IView Update requires time in seconds, not milliseconds.
virtual bool Update(double timeInSeconds) = 0;