perhaps fixing fps issue

This commit is contained in:
bryanthaboi
2026-09-02 10:02:32 -04:00
parent d6c74bb7bb
commit 4b2aa483bb
7 changed files with 58 additions and 2 deletions
+9 -1
View File
@@ -23,7 +23,12 @@ end
-- numeric FrameCap default. Android/iOS/UWP need uncapped probe isolation
-- so composed GLES swapchains can lock; PortMaster handhelds likewise
-- follow KMSDRM through PresentSync.
function FrameCap.loopSupportsPanelSync()
return rawget(_G, "POKEPORT_LOOP_PANEL_SYNC") == true
end
function FrameCap.prefersPanelSync()
if not FrameCap.loopSupportsPanelSync() then return false end
if isHandheldEnv() then return true end
if love and love.system and love.system.getOS then
local osName = love.system.getOS()
@@ -56,7 +61,10 @@ FrameCap.current = FrameCap.DEFAULT
function FrameCap.normalize(value)
value = tonumber(value)
if not value then return FrameCap.DEFAULT end
if value <= 0 then return FrameCap.DISPLAY end
if value <= 0 then
if FrameCap.loopSupportsPanelSync() then return FrameCap.DISPLAY end
return FrameCap.DEFAULT
end
local best, bestDiff = FrameCap.DEFAULT, math.huge
for _, step in ipairs(FrameCap.STEPS) do
local diff = math.abs(step - value)