mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-07 07:55:15 +00:00
Add API functions to set and retrieve frame times
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.
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <projectM-4/render_opengl.h>
|
||||
#include <projectM-4/parameters.h>
|
||||
|
||||
|
||||
namespace libprojectM {
|
||||
@ -179,6 +180,18 @@ void projectm_opengl_render_frame_fbo(projectm_handle instance, uint32_t framebu
|
||||
projectMInstance->RenderFrame(framebuffer_object_id);
|
||||
}
|
||||
|
||||
void projectm_set_frame_time(projectm_handle instance, double seconds_since_first_frame)
|
||||
{
|
||||
auto projectMInstance = handle_to_instance(instance);
|
||||
projectMInstance->SetFrameTime(seconds_since_first_frame);
|
||||
}
|
||||
|
||||
double projectm_get_last_frame_time(projectm_handle instance)
|
||||
{
|
||||
auto projectMInstance = handle_to_instance(instance);
|
||||
return projectMInstance->GetFrameTime();
|
||||
}
|
||||
|
||||
void projectm_set_beat_sensitivity(projectm_handle instance, float sensitivity)
|
||||
{
|
||||
auto projectMInstance = handle_to_instance(instance);
|
||||
|
||||
Reference in New Issue
Block a user