在 Haxe/Starling 中是否有编程方式在运行时更改 vsync?

Is there a programmatic way to change vsync at runtime in Haxe/Starling?

我通过 project.xml 看到了一种方法,但我没有看到在运行时 disable/enable vsync 的方法(例如在设置菜单中有一个选项或其他东西)。搜索没有给我任何答案。 :(

这最多 Lime, which OpenFL is built on top of. Lime itself is built on top of SDL,但您只能通过 Lime 间接访问 SDL API。

查看 Lime 来源和提交历史,您所追求的现在似乎不受支持 - vsync 标志仅传递给初始 CreateWindow() 调用,似乎没有是一种事后更改它的方法/无需创建新的 window.

有人讨论了同样的问题 in the OpenFL forums a few years ago. There, an idea of how this could be implemented in Lime by re-creating the SDL renderer,但提出了不同的标志(指定 SDL_RENDERER_PRESENTVSYNC 与不指定)。如果您需要此功能,您可以考虑自己实现并创建拉取请求。