时间源单位常量 | ||
---|---|---|
常量 | 描述 | 值 |
time_source_units_seconds | Use seconds for the Time Source period (frame-independent) | 0 |
time_source_units_frames | Use 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 (每分钟-毫秒) 作为单位。