Arkadiy_Kolomiets
Topic Author
Posts: 6
Joined: 16 Jun 2024, 07:45

Animation not starting during launching via SDL

30 Jul 2024, 15:53

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?
 
User avatar
jsantos
Site Admin
Posts: 4070
Joined: 20 Jan 2012, 17:18
Contact:

Re: Animation not starting during launching via SDL

31 Jul 2024, 18:35

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)
 
Arkadiy_Kolomiets
Topic Author
Posts: 6
Joined: 16 Jun 2024, 07:45

Re: Animation not starting during launching via SDL

06 Aug 2024, 13:07

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
 
User avatar
jsantos
Site Admin
Posts: 4070
Joined: 20 Jan 2012, 17:18
Contact:

Re: Animation not starting during launching via SDL

06 Aug 2024, 16:46

In your code, 'elapsed_time' is a delta or is it global?
 
User avatar
sfernandez
Site Admin
Posts: 3112
Joined: 22 Dec 2011, 19:20

Re: Animation not starting during launching via SDL

06 Aug 2024, 17:17

Also, IView Update requires time in seconds, not milliseconds.
virtual bool Update(double timeInSeconds) = 0;

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests