Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add external timing API #817

Merged

Conversation

kblaschke
Copy link
Member

Allow apps to set the time before each frame, allowing for non-realtime rendering with fixed or dynamic framerates. Setting the frame time to any value equal to or greater than zero will use this value for the next frame, while setting it to a negative value will make projectM use the system time instead.

The value defaults to -1.0, so if the projectm_set_frame_time() method is not called, projectM will just behave as in previous versions.

Also added another function to retrieve the time of the last rendered frame.

Closes #740

Setting a custom frame time will result in stable animation speeds if projectM does not render at real-time speeds, e.g. while encoding a video from an audio file as fast as possible.
@kblaschke kblaschke added this to the 4.2 milestone Jun 9, 2024
@kblaschke kblaschke self-assigned this Jun 9, 2024
@kblaschke kblaschke merged commit f94f99d into projectM-visualizer:master Jun 21, 2024
9 checks passed
@kblaschke kblaschke deleted the add-external-timing-api branch June 21, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Add the ability to control the actual running time from the outside.
2 participants