Set vsync on launch (might need to be set elsewhere too)

This commit is contained in:
kade-github
2025-04-14 21:42:24 -04:00
committed by Cameron Taylor
parent 3944816021
commit c7c2620217
+3
View File
@@ -13,6 +13,7 @@ import openfl.events.Event;
import openfl.Lib;
import openfl.media.Video;
import openfl.net.NetStream;
import funkin.util.WindowUtil;
/**
* The main class which initializes HaxeFlixel and starts the game in its initial state.
@@ -67,6 +68,8 @@ class Main extends Sprite
funkin.Preferences.lockedFramerateFunction = untyped js.Syntax.code("window.requestAnimationFrame");
#end
WindowUtil.setVSyncMode(funkin.Preferences.vsyncMode);
if (hasEventListener(Event.ADDED_TO_STAGE))
{
removeEventListener(Event.ADDED_TO_STAGE, init);