此函数返回用于渲染游戏的计时方法。
该方法可以是下面列出的常量之一:
显示计时方法常量 | |
---|---|
常量 | 描述 |
tm_sleep | The sleep margin value is the main timing method |
tm_countvsyncs | Vsync timing is the main timing method (default for all supported platforms) |
tm_systemtiming | System timing is the main timing method |
有关不同计时方法的详细信息,请参阅 display_set_timing_method。
display_get_timing_method();
if (display_get_timing_method() != tm_sleep)
{
display_set_timing_method(tm_sleep);
if (display_get_sleep_margin() != 20)
{
display_set_sleep_margin(20);
}
}
上述代码将检查计时方法,如果未设置为 tm_sleep,则会将其设置为该值,并将睡眠裕度设置为 20。