时间源单位

时间源单位常量
常量描述
time_source_units_secondsUse seconds for the Time Source period (frame-independent)0
time_source_units_framesUse frames for the Time Source period (frame-dependent)1

这些常量在 time_source_create()time_source_reconfigure() 中用于设置 时间源 的周期使用的单位,并由 time_source_get_units() 返回。

如果使用秒,时间源将独立于游戏的帧速率运行。

如果使用帧,时间源将取决于游戏的帧速率。

通过调用 time_bpm_to_seconds() 将 BPM 值转换为以秒为单位的时间段,然后使用 time_source_units_seconds 作为单位,也可以使用 BPM (每分钟-毫秒) 作为单位。